Creates a marked extension that recognizes math: TeX the way language models write it,
$…$ and \(…\) inline, $$…$$ and \[…\] for display math (on their own lines or
inside a paragraph), and MathML markup.
The extension only tokenizes. Typesetting needs a math engine, which this
framework-agnostic package doesn't carry, so the HTML path emits a placeholder:
MathML markup (<math>…</math>, or <mml:math> as JATS articles write it) is matched as one
element and emitted with its namespace prefixes removed. Like any raw HTML in markdown it is passed
through as markup, and the host's sanitizer decides what survives (ng-markdown's allows MathML).
Recognizing the math up front also protects it from the rest of the markdown grammar:
a_i and b_j in one formula no longer turn into emphasis, and * is no longer bold.
Math inside code spans and fences is left alone, \$ is a literal dollar sign, and an escaped
bracket ("[1]") stays a bracket.
Creates a marked extension that recognizes math: TeX the way language models write it,
$…$and\(…\)inline,$$…$$and\[…\]for display math (on their own lines or inside a paragraph), and MathML markup.The extension only tokenizes. Typesetting needs a math engine, which this framework-agnostic package doesn't carry, so the HTML path emits a placeholder:
MathML markup (
<math>…</math>, or<mml:math>as JATS articles write it) is matched as one element and emitted with its namespace prefixes removed. Like any raw HTML in markdown it is passed through as markup, and the host's sanitizer decides what survives (ng-markdown's allows MathML).Recognizing the math up front also protects it from the rest of the markdown grammar:
a_iandb_jin one formula no longer turn into emphasis, and*is no longer bold. Math inside code spans and fences is left alone,\$is a literal dollar sign, and an escaped bracket ("[1]") stays a bracket.