Micromark extension for inline math syntax (:math[...])
npm install micromark-extension-math-inlinemicromark extension for inline math syntax (:math[...]).
``bash`
npm install micromark-extension-math-inline
`javascript
import { micromark } from 'micromark'
import { mathInline } from 'micromark-extension-math-inline'
const html = micromark(':math[E = mc^2]', {
extensions: [mathInline()]
})
`
- mathInline — The whole constructmathInlineMarker
- — The :math[ opener and ] closermathInlineData
- — The math content
- Starts with :math[ (no whitespace allowed)]
- Ends with (with bracket balancing)
- Cannot span multiple lines
- Must not be preceded by a word character (a-z, A-Z, 0-9, _)
- \] → escaped ] (doesn't close)\\
- → escaped \\[
- → escaped [` (doesn't affect bracket depth)
MIT