-
I want to add a note feature similar to comments, but without affecting the data structure when selecting text. Any thoughts on how to implement it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
You can use Slate decorations to add mark-like wrappers around ranges of content without mutating the editor value. Be sure to use Slate's range refs to keep these ranges in sync with the editor value, though. You can check Slate's documentation and source code for more information about how to use decorations and range refs. In Plate, you can use the |
Beta Was this translation helpful? Give feedback.
You can use Slate decorations to add mark-like wrappers around ranges of content without mutating the editor value. Be sure to use Slate's range refs to keep these ranges in sync with the editor value, though. You can check Slate's documentation and source code for more information about how to use decorations and range refs. In Plate, you can use the
decorate
plugin option as the entrypoint for implementing decorations.