micromark-extension-math-inline
v1.0.0
Published
Micromark extension for inline math syntax (:math[...])
Maintainers
Readme
micromark-extension-math-inline
micromark extension for inline math syntax (:math[...]).
Install
npm install micromark-extension-math-inlineUsage
import { micromark } from 'micromark'
import { mathInline } from 'micromark-extension-math-inline'
const html = micromark(':math[E = mc^2]', {
extensions: [mathInline()]
})Tokens
mathInline— The whole constructmathInlineMarker— The:math[opener and]closermathInlineData— The math content
Syntax
- 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, _)
Escaping
\]→ escaped](doesn't close)\\→ escaped\\[→ escaped[(doesn't affect bracket depth)
License
MIT
