Support multi-line equations
E.g.
$$\pi$$ works but
$$ \pi $$ does not.
Explanation: Currently I'm detectiong formulas by a stateless per-line regexp. This made it easy to re-typeset only formulas in lines that were changed but expanding the regexp approach to handle multi-line formulas on change events would be tricky and fragile.
Therefore this is blocked on a rewrite that supports stateful parsing in a clean way - as described in #13.
If I want to exactly replicate what pandoc does for single dollars, it will require lookahead beyond current line:
$20,000 and
$30,000
is interpreted as text while
$20,000 and
30,000$
is math. (The real rules for closing $ seems different than documented, with special treatment of numbers. $20,000 and 30,000 $ is still math, an even $20,000 and $b30,000 is math.)
One option is keeping $...$ restricted to one line. In any case (...), $$...$$, [...] will support multi-line.
However, it's not clear that I'm constrained by the fact CodeMirror modes can't lookahead to following line. Math is recognized from change hook which can look everywhere.