diff --git a/packages/client/src/tiptap/core/extensions/callout.ts b/packages/client/src/tiptap/core/extensions/callout.ts index a3cc71e..a587b39 100644 --- a/packages/client/src/tiptap/core/extensions/callout.ts +++ b/packages/client/src/tiptap/core/extensions/callout.ts @@ -69,7 +69,7 @@ export const Callout = Node.create({ addInputRules() { return [ wrappingInputRule({ - find: /^\$callout $/, + find: /^\$callout\$$/, type: this.type, getAttributes: (match) => { return { type: match[1] }; diff --git a/packages/client/src/tiptap/core/extensions/columns.ts b/packages/client/src/tiptap/core/extensions/columns.ts index b3fd484..b2ceb7b 100644 --- a/packages/client/src/tiptap/core/extensions/columns.ts +++ b/packages/client/src/tiptap/core/extensions/columns.ts @@ -268,7 +268,7 @@ export const Columns = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$columns $/, + find: /^\$columns\$$/, type: this.type, getAttributes: () => { return { type: 'left-right', columns: 2 }; diff --git a/packages/client/src/tiptap/core/extensions/countdown.ts b/packages/client/src/tiptap/core/extensions/countdown.ts index 4e31730..0265261 100644 --- a/packages/client/src/tiptap/core/extensions/countdown.ts +++ b/packages/client/src/tiptap/core/extensions/countdown.ts @@ -78,7 +78,7 @@ export const Countdown = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$countdown $/, + find: /^\$countdown\$$/, type: this.type, getAttributes: () => { return { width: '100%' }; diff --git a/packages/client/src/tiptap/core/extensions/excalidraw.ts b/packages/client/src/tiptap/core/extensions/excalidraw.ts index 030d9bb..d36da5c 100644 --- a/packages/client/src/tiptap/core/extensions/excalidraw.ts +++ b/packages/client/src/tiptap/core/extensions/excalidraw.ts @@ -103,7 +103,7 @@ export const Excalidraw = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$excalidraw $/, + find: /^\$excalidraw\$$/, type: this.type, getAttributes: () => { return { width: '100%' }; diff --git a/packages/client/src/tiptap/core/extensions/flow.ts b/packages/client/src/tiptap/core/extensions/flow.ts index 9c40791..8c795cc 100644 --- a/packages/client/src/tiptap/core/extensions/flow.ts +++ b/packages/client/src/tiptap/core/extensions/flow.ts @@ -108,7 +108,7 @@ export const Flow = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$flow $/, + find: /^\$flow\$$/, type: this.type, getAttributes: () => { return { width: '100%', defaultShowPicker: true, createUser: this.options.getCreateUserId() }; diff --git a/packages/client/src/tiptap/core/extensions/iframe.ts b/packages/client/src/tiptap/core/extensions/iframe.ts index ae8493c..5b34c0c 100644 --- a/packages/client/src/tiptap/core/extensions/iframe.ts +++ b/packages/client/src/tiptap/core/extensions/iframe.ts @@ -98,7 +98,7 @@ export const Iframe = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$iframe $/, + find: /^\$iframe\$$/, type: this.type, getAttributes: () => { return { width: '100%' }; diff --git a/packages/client/src/tiptap/core/extensions/katex.ts b/packages/client/src/tiptap/core/extensions/katex.ts index 9cf31aa..7e655d9 100644 --- a/packages/client/src/tiptap/core/extensions/katex.ts +++ b/packages/client/src/tiptap/core/extensions/katex.ts @@ -78,7 +78,7 @@ export const Katex = Node.create({ addInputRules() { return [ nodeInputRule({ - find: /^\$katex $/, + find: /^\$katex\$$/, type: this.type, getAttributes: () => { return { defaultShowPicker: true, createUser: this.options.getCreateUserId() }; diff --git a/packages/client/src/tiptap/editor/collaboration/kit.ts b/packages/client/src/tiptap/editor/collaboration/kit.ts index c188c8d..ef5ff56 100644 --- a/packages/client/src/tiptap/editor/collaboration/kit.ts +++ b/packages/client/src/tiptap/editor/collaboration/kit.ts @@ -83,7 +83,7 @@ const placeholders = [ '使用 markdown 语法进行输入', '输入 @ 来提及他人', '输入 : 来插入表情', - '你知道吗?输入 $katex 然后按一下空格就可以快速插入数学公式,其他节点操作类似哦', + '你知道吗?输入 $katex 然后在输入一个 $ 就可以快速插入数学公式,其他节点操作类似哦', ]; const getCreateUserId = () => safeJSONParse(window.localStorage.getItem('user')).id;