Skip to main content
Apply background colors to emphasize important text. Color-coded highlighting for review, categorization, and emphasis.

OOXML Structure

<w:r>
  <w:rPr>
    <w:highlight w:val="yellow"/>
  </w:rPr>
  <w:t>Highlighted text</w:t>
</w:r>

Use Case

  • Document review - Color-code feedback
  • Study notes - Highlight key concepts
  • Status tracking - Visual progress indicators
  • Multi-reviewer - Each person uses different color
  • Categorization - Group related content by color

Options

Configure the extension behavior:
htmlAttributes
Object
default:"{}"
HTML attributes for highlight elements

Attributes

Node attributes that can be set and retrieved:
color
string
Background color (CSS color value)

Commands

setHighlight

Apply highlight with specified color Example:
editor.commands.setHighlight('#FFEB3B')
editor.commands.setHighlight('rgba(255, 235, 59, 0.5)')
Parameters:
color
string
required
CSS color value

unsetHighlight

Remove highlight formatting Example:
editor.commands.unsetHighlight()

toggleHighlight

Toggle highlight formatting Example:
editor.commands.toggleHighlight()

Keyboard Shortcuts

CommandShortcutDescription
toggleHighlight()⌘/Ctrl-Shift-hToggle highlighted formatting

Source Code

I