Replies: 1 comment 7 replies
-
Have you found any solution for this? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Big thanks for all the work so far, I am enjoying using lexical!
I've created a custom node type called Placeholder, you can insert into a heading, paragraph, list, etc. The placeholder values are then replaced using handlebars later down the line once we've exported markdown.
Below the text editor UI you can see exporting to markdown is fine, however I'm curious about the best way to import this into the editor with a custom transformer with
initialEditorState
. The placeholder node can exist as a child of multiple different text node types (h1, h2, p, list, etc.).Question:
What would be the best way to replace the matched string and preserve the sibling text nodes?
PlaceHolderNode
Custom Transformer
Line in above transformer
parentNode.replace([startNode, node, endNode]);
wont work obviously but how can I replace the current node I'm in with the new created nodes?Beta Was this translation helpful? Give feedback.
All reactions