import 'codemirror/addon/mode/multiplex'; import 'codemirror/mode/stex/stex'; // Joplin markdown is a the same as markdown mode, but it has configured defaults // and support for katex math blocks export default function useJoplinMode(CodeMirror: any) { CodeMirror.defineMode('joplin-markdown', (config: any) => { const markdownConfig = { name: 'markdown', taskLists: true, strikethrough: true, emoji: true, tokenTypeOverrides: { linkText: 'link-text', }, }; const markdownMode = CodeMirror.getMode(config, markdownConfig); const stex = CodeMirror.getMode(config, { name: 'stex', inMathMode: true }); const inlineKatexOpenRE = /(?