Underline TextNode based on cursor position #4698
Unanswered
tomaszferens
asked this question in
Q&A
Replies: 1 comment
-
@tomaszferens did you get the answer to handle this kind of node transformations? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to achieve a following functionality:
(notice that "are" is underlined while other words are normal). The cursor position decides what TextNode should be underlined.
I tried to use
editor.registerNodeTransform(TextNode, (textNode) => {})
to split single TextNode into multiple TextNodes (splitting by space " " character) andeditor.registerCommand(SELECTION_CHANGE_COMMAND, () => {})
to achieve it but i'm having issues with lexical infinitely updating itself.Here is a gist:
DEMO
what am I doing wrong? 🤔
Beta Was this translation helpful? Give feedback.
All reactions