@arkpad/extension-highlight
v1.0.2
Published
The Highlight extension allows you to mark text with a background color, similar to a physical highlighter.
Readme
@arkpad/extension-highlight
The Highlight extension allows you to mark text with a background color, similar to a physical highlighter.
Installation
npm install @arkpad/extension-highlightUsage
Commands
setHighlight(attributes)
Sets a highlight mark.
editor.runCommand("setHighlight", { color: "#ffcc00" });toggleHighlight(attributes)
Toggles a highlight mark.
editor.runCommand("toggleHighlight");unsetHighlight()
Removes all highlight marks.
editor.runCommand("unsetHighlight");Keyboard Shortcuts
Mod-Shift-h: Toggles highlight with default color.
Configuration
HTMLAttributes
Custom HTML attributes for the rendered mark tag.
Highlight.configure({
HTMLAttributes: {
class: "my-custom-highlight",
},
});color
The default highlight color.
Highlight.configure({
color: "#ffcc00",
});