Files
docmost-mcp/src/lib/tiptap-extensions.ts
aleleba 23fa372774 fix: add TableKit to preserve GFM tables on updatePage
Closes #2

GFM tables were corrupted when using update_page because the
Markdown → HTML (marked) → ProseMirror JSON (generateJSON) flow did not
recognize <table>, <tr>, <th>, <td> 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.
2026-05-30 20:32:44 -06:00

23 lines
686 B
TypeScript

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
codeBlock: {},
heading: {},
}),
Image.configure({
inline: false,
}),
Link.configure({
openOnClick: false,
}),
TableKit,
];