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.
This commit is contained in:
@@ -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,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user