Prevent math delimiters inside TeX brace groups and percent comments from prematurely closing an equation: * Generalize the existing inline `\text` group handling to arbitrary brace groups, and support groups in display math too. * Recognize unescaped `%` as starting a comment through the next newline. Ignore any braces or math delimiters within it. Developed with OpenAI Codex. PR revised by John MacFarlane.
88 B
88 B
% pandoc -t latex -f native
[Math InlineMath "x=y%comment"]
^D
\(x=y%comment
\)