Every extension
mathBlock
A formula on a line of its own.
The same node as `mathInline` in every way but where it sits: a block, so `ctx.insert` splits the paragraph around it and `$$E=mc^2$$ ` typed at the start of a paragraph replaces the paragraph with it.
Adding it
import { createEditor, document, paragraph, text, mathBlock } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, mathBlock({ … })],
element: document.querySelector('#editor'),
})
There is no separate package · mathBlock is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.insertBlockMath()
Attributes
-
latex
HTML
-
Parses
div[data-math] -
Renders
div