From d2d3051f748a7a2677897ab0a0c7171645fef18d Mon Sep 17 00:00:00 2001 From: 950288 <950288s@gmail.com> Date: Thu, 1 Feb 2024 23:05:45 +0800 Subject: [PATCH] Update TablePro component to allow table content --- FrontEnd/src/components/TablePro.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FrontEnd/src/components/TablePro.ts b/FrontEnd/src/components/TablePro.ts index f36f874..5a0ffd8 100644 --- a/FrontEnd/src/components/TablePro.ts +++ b/FrontEnd/src/components/TablePro.ts @@ -34,7 +34,7 @@ export default Node.create({ group: "block", - content: "paragraph", + content: "paragraph table", defining: false, @@ -59,13 +59,13 @@ export default Node.create({ insertTablePro: ({ rows = 2, cols = 2, withHeaderRow = true } = {}) => ({ editor, tr }) => { - const table = createTable(editor.schema, rows, cols, withHeaderRow); - const noteNode = editor.schema.nodes.paragraph.createChecked( { class: "tableNote" }, [editor.schema.text("add table note here")], ); + const table = createTable(editor.schema, rows, cols, withHeaderRow); + if (!noteNode) { return false; }