Repository navigation
mdastic@0.2.0
-
New opt-in math syntax. Parse and serialize
$x$inline math and$$blocks with the same nodes, positions and markdown as remark-math:import { parse, stringify } from 'mdastic' import { math } from 'mdastic/math' const syntax = [math()] const tree = parse('Energy: $E = mc^2$', { syntax }) if (tree instanceof Error) throw tree const markdown = stringify(tree, { syntax })
Use
math({ singleDollarTextMath: false })to require at least two dollars for inline math. Withoutmath(), dollar signs remain ordinary text.