Skip to content

Comments

Fix text content in inline embedded nodes#57

Open
jmoggr wants to merge 3 commits intoautomerge:mainfrom
jmoggr:fix-inline-embeds
Open

Fix text content in inline embedded nodes#57
jmoggr wants to merge 3 commits intoautomerge:mainfrom
jmoggr:fix-inline-embeds

Conversation

@jmoggr
Copy link

@jmoggr jmoggr commented Feb 9, 2026

Note: I leaned heavily on LLMs for this. I'm confident in my understanding of the problem, but I am not confident in understanding my proposed fix in the context of the whole project.

Replaying automerge spans produced incorrect prosemirror documents when inline embedded nodes contain text. Text content inside the node would move outside the inline embedded node as a sibling after a save/load cycle. In traverseSpans, the newBlock method treats all embed blocks as leaf nodes so subsequent text spans are then added to the parent container instead of the embed.

This is fixed by checking if the node is lineline and can contain text then the nodes is pushed so that subsequent text becomes children.

This is "stacked" on top of #56 and #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant