Skip to content

Commit

Permalink
Update transforms.md (facebook#3845)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benbinbin authored Feb 8, 2023
1 parent 14cd2a6 commit 35c1b0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lexical-website/docs/concepts/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ editor.registerNodeTransform(TextNode, textNode => {
if (textNode.getTextContent() === 'modified') {
textNode.setTextContent('re-modified');
}
}
})
// Plugin 2
editor.registerNodeTransform(TextNode, textNode => {
// This transform runs only once
if (textNode.getTextContent() === 'original') {
textNode.setTextContent('modified');
}
}
})
// App
editor.addListener('update', ({editorState}) => {
const text = editorState.read($textContent);
Expand Down

0 comments on commit 35c1b0b

Please sign in to comment.