@edtr-io/plugin-text
Version:
## Table of contents
16 lines (11 loc) • 355 B
text/typescript
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
}