mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-24 07:52:50 +02:00
Allow void elements to receive marks (#5135)
Some void elements are effectively stand-ins for text, such as with the mentions example, where the mention element renders the character's name. Users might want to format Void elements like this with bold, or set their font and size, so `editor.markableVoid` tells Slate whether or not to apply Marks to the text children of void elements. - Adds `markableVoid()` as a schema-specific overrideable test. - Changes `addMark` and `removeMark` so marks can apply to voids. Also changes behavior of collapsed selection so that if a markable Void is selected, the mark will be applied / removed. - Shows how `markableVoid()` can work in the mentions example
This commit is contained in:
5
.changeset/modern-cooks-grow.md
Normal file
5
.changeset/modern-cooks-grow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate': patch
|
||||
---
|
||||
|
||||
Allow void elements to receive marks via markableVoid()
|
Reference in New Issue
Block a user