SIGN IN SIGN UP

refactor(utils): extracted the LaTeX delimiter grammar into math-delimiters

The TUI owned the production rules for dollar and bracket math — pandoc's
anti-currency heuristic, escaped dollars, own-line display blocks — stated once
in the markdown tokenizer and again in `renderMathInText`. They now live in
`@oh-my-pi/pi-utils/math-delimiters`, which answers where a span starts and ends
in source offsets and carries no rendering policy, so a second renderer can
share the rules without inheriting the terminal's presentation.

The TUI keeps its own policy: unclosed openers still fall through to marked's
escape and text rules, and bodies still reach `latexToUnicode` verbatim.

One behavior change rides along: a span now ends at the first *unescaped*
delimiter, so `\(a \\) b\)` is one equation rather than closing inside the TeX
row break, and an escaped `\$` no longer ends `$$…$$`. Rendering is otherwise
unchanged — measured against a 6,048-case corpus of delimiter permutations
(5 inputs differ, all of that shape) and an exhaustive sweep of every string up
to length 4 over the delimiter alphabet (byte-identical).

`inlineMathSpanEnd` and `mathStartIndex` are no longer exported from
`@oh-my-pi/pi-tui`; both had no consumers outside the package.
S
Sean Murphy committed
03ba093464e6891feb768a17197e2e34dccb670a
Parent: b4e8e85