facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.98k stars 1.7k forks source link

[lexical-list] Bug Fix: Handle appending inline element nodes in ListNode.append #6791

Closed amanharwara closed 2 weeks ago

amanharwara commented 3 weeks ago

Currently, ListNode.append will always convert an element node into a text node, even if the element node is inline and can be appended as a whole which can end up removing formatting and unwrapping things like links.

While this is rarely hit, since most of the code in the lexical codebase accounts for appending to a child list item instead of the list directly, I think it still makes sense for this to be correct.

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 2:15pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 2:15pm
github-actions[bot] commented 3 weeks ago

size-limit report 📦

Path Size
lexical - cjs 29.94 KB (0%)
lexical - esm 29.78 KB (0%)
@lexical/rich-text - cjs 38.59 KB (0%)
@lexical/rich-text - esm 31.65 KB (0%)
@lexical/plain-text - cjs 37.25 KB (0%)
@lexical/plain-text - esm 28.94 KB (0%)
@lexical/react - cjs 40.32 KB (0%)
@lexical/react - esm 33.01 KB (0%)
Shopiley commented 1 week ago

Hi, I've added a test for this bug fix here: https://github.com/facebook/lexical/pull/6826

also wanted to point out that this PR fixes issue #6793 so we can close that.