fix(editor): avoid copying paraId on split#3412
Conversation
Prevent split-created paragraphs from inheriting DOCX paragraph identity, which can create duplicate node IDs after splitting table separator paragraphs. Closes superdoc-dev#3405
caio-pizzol
left a comment
There was a problem hiding this comment.
@wookieb thanks for the PR. this matches the editor split path, and the regression test covers the reported duplicate paraId case. lgtm once the inline is handled.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
after this + the // split-run.js, replacing the spread at 97-105
const extensionAttrs = editor?.extensionService?.attributes ?? [];
paragraphAttrs = Attribute.getSplittedAttributes(extensionAttrs, node.type.name, node.attrs);one wrinkle: |
|
That was a good tip @gpardhivvarma - Thank You :) |
Summary
Closes #3405
Considerations
Regular
splitRunToParagraphdoes not copyparaIdon purpose. Split on empty paragraph is special, therefore I believe the best fix is to just mark attribute as ignored onsplit.I was thinking about not having
paraIdat for table separator but I've noticed it was added on purpose in recent months. Unless... I'm wrong?