Skip to content

Commit 1b75fcd

Browse files
committed
feat: 在Markdown编辑器中支持表格行和单元格的节点操作,增强表格内部节点的验证逻辑
1 parent d464914 commit 1b75fcd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/MarkdownEditor/editor/plugins/withMarkdown.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const TableInlineNode = new Set([
99
'inline-katex',
1010
'paragraph',
1111
'footnoteDefinition',
12+
'table-row',
13+
'table-cell',
1214
'media',
1315
]);
1416

@@ -213,13 +215,16 @@ export const withMarkdown = (editor: Editor) => {
213215
) {
214216
if (TableInlineNode.has(operation.node.type) || !operation.node.type) {
215217
apply(operation);
218+
return;
216219
}
217220
if (operation.node.type === 'card') {
218221
const relativeNode = operation.node.children.at(1);
219222
if (TableInlineNode.has(relativeNode.type)) {
220223
apply(operation);
224+
return;
221225
}
222226
}
227+
console.log('parentNode', operation.node);
223228
message.error('表格内部只支持行内节点!');
224229
return;
225230
}

0 commit comments

Comments
 (0)