You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make color highlighting disablable via Lexxy.configure (highlight: { enabled: false }) or a highlight element attribute. The default stays enabled, preserving current behavior. Both the object form { enabled: false } and a bare highlight: false are accepted.
When disabled: the HighlightExtension (toggle/remove commands, the <mark> import converter, paste canonicalizers) is not registered, the toolbar highlight dropdown is hidden via a data-highlight attribute, the dropdown setup is guarded, and highlight markup is reduced to plain text on import — both <mark> (by dropping the conversion) and legacy Trix styled elements (em/strong/span/del keep their bold/italic/strikethrough but lose the highlight color).
Copy file name to clipboardExpand all lines: docs/configuration.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Editors support the following options, configurable using presets and element at
50
50
-`multiLine`: Pass `false` to force single line editing.
51
51
-`permittedAttachmentTypes`: Restrict the editor to a specific allowlist of attachment content types. Unset (the default) permits any content type. Example: `<lexxy-editor permitted-attachment-types="application/vnd.basecamp.mention application/vnd.basecamp.opengraph-embed"></lexxy-editor>`.
52
52
-`richText`: Pass `false` to disable rich text editing.
53
+
-`highlight`: Color highlighting configuration. Pass `{ enabled: false }` (or simply `false`) to disable highlighting entirely (it is enabled by default). See [Highlighting](highlighting.md) for configuring the available colors.
53
54
54
55
The toolbar is considered part of the editor for `lexxy:focus` and `lexxy:blur` events. If the toolbar registers event or lexical handlers, it should expose a `dispose()` function which will be called on editor disconnect.
Copy file name to clipboardExpand all lines: docs/highlighting.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,3 +32,19 @@ Lexxy.configure({
32
32
}
33
33
})
34
34
```
35
+
36
+
## Disabling highlighting
37
+
38
+
Pass `highlight.enabled: false` to disable color highlighting entirely. The toolbar control is hidden, the commands become inert, and existing highlight markup is reduced to plain text on load.
39
+
40
+
```javascript
41
+
Lexxy.configure({
42
+
default: {
43
+
highlight: { enabled:false }
44
+
}
45
+
})
46
+
```
47
+
48
+
Or per editor: `<lexxy-editor highlight='{"enabled":false}'></lexxy-editor>`.
49
+
50
+
A bare boolean is also accepted as a shorthand — `highlight: false` in a preset, or `<lexxy-editor highlight="false">`.
0 commit comments