Bug: update_page silently drops images due to mismatched Tiptap Image extension config #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When using
update_pagewith markdown content containing images (e.g.), the images are silently dropped from the page content. The text content updates fine, but all image nodes are missing from the resulting Tiptap/ProseMirror document.Root Cause
In
src/lib/tiptap-extensions.ts, the Image extension is configured withinline: true:However, Docmost's actual image extension (source) defines images as block-level nodes:
When the MCP's
update_pagepipeline runs (markdown →marked.parse()→ HTML →generateJSON()→ Tiptap JSON → Yjs), it creates inline image nodes inside paragraphs. But Docmost's Yjs document expects block-level image nodes. The Yjs merge silently discards the mismatched nodes.Steps to Reproduce
POST /api/files/uploadendpointupdate_pagewith markdown containingExpected Behavior
Images in the markdown should be preserved as block-level image nodes in the page content.
Fix
Change
inline: truetoinline: falseinsrc/lib/tiptap-extensions.ts:This aligns the MCP's Tiptap schema with Docmost's actual editor schema.
Workaround
Use the
/pages/importendpoint instead ofupdate_pagefor content that includes images.