Fix delete forward list for items with multiple children#2597
Fix delete forward list for items with multiple children#259712joan merged 6 commits intoudecode:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 00e15fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Thank you @nicktrn for this first contribution! |
5d78858 to
96ce051
Compare
|
Appreciate you putting in the PR and splitting it with me, @nicktrn 🤍 This is something that's adding value to Slate / Plate for a issue that hasn't been resolved for a year! |
|
Thanks for the PR. I've rewarded the bounty. Hopefully that got split between the two of you like Algora said it would; the rewarding UI wasn't very clear about that. (@rishi-raj-jain If it didn't send you anything, I can remedy that with the /tip command.) Would it be possible to extend this fix to also cover #1152, a related issue that occurs when deleting backward? recording.mp4 |
|
@12joan Sure thing, will finish this up as soon as I get a chance. Glad everything worked out with the split in the end! @rishi-raj-jain No worries, I'm sure we both banged our head against the wall with this one. |
|
Thanks, @nicktrn! Let's see if this works... /tip 50 |
|
🎉🎈 @nicktrn has been awarded $50! 🎈🎊 |
|
The two of you sure are fast. Glad both issues are now resolved. Thanks for the tip! #1152 will have to be manually closed as I forgot to tag it as fixed. |
Description
Slate's
deleteForwardleaves behind an empty node when merging list items with multiple children, e.g. marked and unmarked text. To avoid duplicating otherwise sound delete logic, this fix callsdeleteForwardfirst and then deletes the empty node.An alternative attempt included unwrapping LICs, letting vanilla
deleteForwarddo its magic, and counting on normalization to fix things up. Sadly, edge cases were non-trivial to solve.Tests
Added two tests, one for the issue at hand and one for sublists re #1152. However, the sublist test that should have failed passes just fine even before this fix. It's possible this has something to do with the editor config instead.
Fixes #2420
/claim #2420
/split @rishi-raj-jain