This is similar to what was included above, but this is the parser I’m currently using to mark regions as InlineMath
or BlockMath
.
The variant of markdown the parser is for, however, only supports $$
at the beginning of a line and uses $
for inline math.
I haven’t tried using it yet, but it looks like a 3rd-party lezer parser for TeX exists (lezer-tex
on npm
).