Skip to main content
The Highlight extension allows you to highlight text with background colors. Text is rendered as a <mark> HTML element by default.

Installation

Usage

Keyboard Shortcuts

  • Mod-Shift-h - Toggle highlight formatting

Markdown Support

The extension supports markdown syntax for highlighted text:
  • Type ==text== to create highlighted text

Configuration Options

boolean
default:"false"
Allow multiple highlight colors. When enabled, you can specify custom colors for highlights.
Record<string, any>
default:"{}"
HTML attributes to add to the highlight element.

Commands

setHighlight(attributes?)

Set a highlight mark on the current selection. When multicolor is enabled, you can specify a color.

toggleHighlight(attributes?)

Toggle the highlight mark on the current selection.

unsetHighlight()

Remove the highlight mark from the current selection.

Using Multiple Colors

To use multiple highlight colors, enable the multicolor option:
When multicolor is enabled, the color is stored as a data-color attribute and applied as an inline style.

Source Code

View the source code on GitHub: