Skip to content

How to highlight selected text without affecting the document structure. #3211

Answered by 12joan
wenyongqd asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@wenyongqd
Comment options

@12joan
Comment options

@wenyongqd
Comment options

@12joan
Comment options

@wenyongqd
Comment options

Answer selected by wenyongqd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants