From 23fa3727745270f54bcd858ab369d8cf89621175 Mon Sep 17 00:00:00 2001 From: aleleba Date: Sat, 30 May 2026 20:32:44 -0600 Subject: [PATCH] fix: add TableKit to preserve GFM tables on updatePage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #2 GFM tables were corrupted when using update_page because the Markdown → HTML (marked) → ProseMirror JSON (generateJSON) flow did not recognize , ,
, elements. Adding TableKit from @tiptap/extension-table registers the required schema so tables round-trip correctly in both create and update flows. Tested on Docmost 0.70.1. Fixes PR #6 from the original repo. --- src/lib/tiptap-extensions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/tiptap-extensions.ts b/src/lib/tiptap-extensions.ts index cc235ba..380818c 100644 --- a/src/lib/tiptap-extensions.ts +++ b/src/lib/tiptap-extensions.ts @@ -1,9 +1,11 @@ import StarterKit from "@tiptap/starter-kit"; import Image from "@tiptap/extension-image"; import Link from "@tiptap/extension-link"; +import { TableKit } from "@tiptap/extension-table"; // Define extensions compatible with standard Markdown features // We use the default Tiptap extensions to handle basic content +// TableKit is required for generateJSON to parse HTML tables from marked (GFM tables) export const tiptapExtensions = [ StarterKit.configure({ // Explicitly enable features that might be disabled in some contexts @@ -16,4 +18,5 @@ export const tiptapExtensions = [ Link.configure({ openOnClick: false, }), + TableKit, ];