#4289·KaTeX

Remove single character surrogate pairs from source code.

Author: angathaCreated Sep 15, 2026Updated Sep 15, 2026
Labelsenhancement

Is your feature request related to a problem? Please describe.

We use the Artemis application, which internally uses KaTeX. It repackaged (maybe not correct term, I'm not familiar with js world) the dependency and that changes a regex used for lexing. That results in Formulas like \frac{1}{2} to tokenize wrongly. (First token should be \frac but the modified code returns \f)

Related issue there is https://github.com/ls1intum/Artemis/issues/13818

Describe the solution you'd like: I already created a patch for Artemis that shifts the decoding of the \\\uxxxx to the regex engine. (Use \\uD800 instead of \uD800 and so on.) I would assume that this is not just an artemis problem and would therefore ask to apply the patch here. Then Artemis does not need to keep track of it.

Link to or name of a (La)TeX package that provides the same feature: https://github.com/ls1intum/Artemis/pull/13838

Describe alternatives you've considered: Keep manual patches at Artemis

Additional context: