lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Line break inside link node appends text to the end of the current paragraph

Open micnic opened this issue 5 months ago • 0 comments

When inserting a line break by pressing Enter while the cursor is inside a link the part of the link that is at the end will go to the end of the current paragraph and not to the start of the next line. Follow the steps to reproduce for an example or see the attached video.

Lexical version: 0.17.1

Steps To Reproduce

  1. Have the text Some text. https://www.google.com Some other text. in the editor https://playground.lexical.dev/
  2. Set the cursor inside the link, for example between c and o: https://www.google.c|om
  3. Press ENTER

https://github.com/user-attachments/assets/45573cee-8dbf-46f3-9442-9c631b9871f6

Link to code example:

The current behavior

After following the steps to reproduce we have 3 paragraphs with the following content:

Some text. https://www.google.c
 Some other text.
om

The expected behavior

It was expected to have only 2 paragraphs with the content:

Some text. https://www.google.c
om Some other text.

Impact of fix

  • Low severity
  • Any user that uses link nodes may be affected

micnic avatar Sep 12 '24 13:09 micnic