lexical
lexical copied to clipboard
Bug: Additional paragraph inserted when pressing "Enter" within AutoLinkNode
When pressing "Enter" and the cursor is within an AutoLinkNode, the link is split into two paragraphs, but there is also an empty paragraph is inserted in between. This is also reproducible in the Playground.
Lexical version: 0.14.3
Steps To Reproduce
- Visit playground and delete demo text
- Type "http://example.com"
- Press left arrow key to move cursor one character to the left
- Press "Enter"
Link to code example: https://playground.lexical.dev/
https://github.com/facebook/lexical/assets/5648131/04f1b334-e41d-4f46-94d2-2e01cbbdd52a
The current behavior
There are 3 paragraphs, because an additional empty ParagraphBlock is inserted.
The expected behavior
There should be 2 paragraphs, one with text content http://example.co, and one with text content m.