-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: $getRoot().getTextContent() new line inconsistencies #8096
Copy link
Copy link
Closed
Labels
coreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Composition
Description
Lexical version: 0.38.2
Steps To Reproduce
- Load previously stored serialized state with multiple paragraphs.
- Notice (console) how there are 4x \n between paragraphs.
- Now add a space at the end.
- Notice how there are now 2x \n between paragraphs.
- Select end and press Enter 2x and type anything.
- Notice there are 4x \n.
Link to code example: https://codesandbox.io/p/devbox/priceless-meadow-kmlmj2
The current behavior
Inconsistent number of new lines in between paragraphs in $getRoot().getTextContent() output.
The expected behavior
Consistent number of new lines in between paragraphs in $getRoot().getTextContent() output.
Impact of fix
I am using $getRoot().getTextContent() to get text diff between initial and final state. The inconsistencies report fake addition/removals of new lines.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Composition