Skip to content

400-srv71-web51

@jnu jnu tagged this 04 Sep 17:10
Fixes #454 (and hopefully doesn't lead to new problems!)

Detect `\begin{*} ... \end{*}` blocks that haven't been given explicit
delimiters that KaTeX normally expects (such as `$$...$$`). Essentially
this just means treating `\begin` and `\end` as delimiters themselves,
with a couple of complications:

1. Unlike $$...$$ we _keep_ the begin/end delimiters in the KaTeX, since
the environment is actually meaningful and will change rendering (e.g.,
`\begin{align*}` is different from `\begin{multiline*}`).
2. We need to match the `\end` environment with the `\begin` (so,
`\begin{align*}` can't be terminated by `\end{multiline*}`).

There are still edge cases that could come up (it's obviously hard to
predict what the LLM will end up spewing out), but hopefully this fixes
the case that was observed earlier.
Assets 2
Loading