How to edit each paragraph node correctly? #2259
-
We want to check the characters of each paragraph. If there are qualified paragraphs in it, we need to modify the text of the node, and refresh the view of the editor after batch checking. First, we pass the But next, we don't know how to feed back to the editor to tell it that the content of the node has been modified and that the view needs to be refreshed. thx.so much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Mutating the dom directly is not supported by ProseMirror. You have to iterate over |
Beta Was this translation helpful? Give feedback.
Mutating the dom directly is not supported by ProseMirror. You have to iterate over
state.doc.descendants
and create a transaction to change the state.