UNPKG

@edtr-io/plugin-text

Version:
16 lines (11 loc) 355 B
import { Editor as SlateEditor } from 'slate' export const withMath = (editor: SlateEditor) => { const { isInline, isVoid } = editor editor.isInline = (element) => { return element.type === 'math' ? true : isInline(element) } editor.isVoid = (element) => { return element.type === 'math' ? true : isVoid(element) } return editor }