UNPKG

@rtdui/editor

Version:

React rich text editor based on tiptap

22 lines (19 loc) 686 B
const require_math_katex_inline_plugin = require('./math-katex-inline-plugin.cjs'); let _tiptap_core = require("@tiptap/core"); //#region packages/editor/src/RichTextEditor/tiptap_extensions/extension-math/math-katex-inline.ts /** 将文档中所有段落中的$...$转换为katex */ const MathKatexInline = _tiptap_core.Extension.create({ name: "mathKatex", addOptions() { return { katexOptions: {} }; }, addProseMirrorPlugins() { return [...this.parent?.() || [], require_math_katex_inline_plugin.KatexInlinePlugin({ editor: this.editor, name: this.name, katexOptions: this.options.katexOptions })]; } }); //#endregion exports.MathKatexInline = MathKatexInline;