You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
text-editor deletes image embeds — and the table cell or paragraph around them — when saving Markdown #3434
I understand this is a bug report and questions should be posted in the Discussions
I searched the issues and discussions of opencloud-eu/web, opencloud-eu/opencloud and opencloud-eu/web-extensions and found nothing about this
Bug Description
Saving a Markdown file in the text editor deletes every image embed () that does not stand alone in its own paragraph. The image files stay untouched, but the node around the embed is deleted too:
an embed in a table cell deletes the whole cell, so the following cells shift one column to the left
an embed next to text in a paragraph or list item deletes the whole paragraph, text included
There is no warning. In our instance this would affect 94 of 311 notes with images; 54 of them would also lose text.
Reproduction Steps
Upload this file as test.md:
| Image | Name ||---|---||| Alpha ||| Beta |
Some text  more text.
- Looks like this:
Open it in the text editor, change any word, save.
@tiptap/extension-paragraph turns a paragraph that holds only an image into a bare image node. All other images stay inline inside a paragraph, and table cells always wrap their content in one.
The markdown strategy configures images as block nodes (inline: false), so an image inside a paragraph is invalid.
The Yjs binding cannot build the invalid paragraph and deletes it (createNodeFromYElement). This also happens in local mode without a Yjs server. Without Yjs, the embeds survive.
inline: true alone is not enough: a lone image inside a blockquote then deletes the blockquote. What worked in our tests was inline: true plus a paragraph extension that does not unwrap a lone image. With both changes, all 1,308 embeds in our notes survive a round trip.
Setup
OpenCloud 8.0.1 (Web 8.0.0), no Yjs server configured. We tested the table case in the browser and reproduced the other cases headless with Tiptap 3.31.3 and @tiptap/y-tiptap 3.0.9. The script is available on request.
Activity
fix: keep image embeds in markdown when saving