Skip to content

text-editor deletes image embeds — and the table cell or paragraph around them — when saving Markdown #3434

Closed

Description

@duderik

Initial Checklist

  • 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

  1. Upload this file as test.md:

    | Image | Name |
    |---|---|
    | ![](a.png) | Alpha |
    | ![](b.png) | Beta |
    
    Some text ![](c.png) more text.
    
    - Looks like this:![](d.png)
    
    ![](e.png)
  2. Open it in the text editor, change any word, save.

Expected Outcome

All embeds, cells and text are kept.

Actual Outcome

| Image | Name |
| ----- | ---- |
| Alpha |      |
| Beta  |      |


![](e.png)

Only the standalone embed e.png survives.

Cause

  • @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.

Related: #2600, opencloud-eu/opencloud#3414

Activity

  1. self-assigned this
    on Nov 6, 2026
  2. moved this from Prio <= 3 to In Progress in OpenCloud Team Boardon Nov 6, 2026
  3. added a commit that references this issue on Nov 6, 2026
    a733143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions