添加插入数学公式菜单

This commit is contained in:
wux_labs
2025-02-18 21:25:48 +08:00
parent 501e6e33eb
commit 8d513d1191
5 changed files with 94 additions and 0 deletions
+8
View File
@@ -17,6 +17,8 @@ import { TextAlign } from "@tiptap/extension-text-align";
import { TextStyle } from "@tiptap/extension-text-style";
import { Underline } from "@tiptap/extension-underline";
import { Mathematics } from '@tiptap-pro/extension-mathematics';
import BulletList from "../extensions/BulletList.ts";
import FontSize from "../extensions/FontSize.ts";
import Image from "../extensions/Image.ts";
@@ -54,6 +56,12 @@ export const allExtensions = (uaiEditor: UAIEditor, _options: UAIEditorOptions):
Indent,
LineHeight,
Link,
Mathematics.configure({
shouldRender: (state, pos, node) => {
const $pos = state.doc.resolve(pos)
return node.type.name === 'text' && $pos.parent.type.name !== 'codeBlock'
}
}),
NodeAlign,
OrderedList,
SelectFile.configure({