mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 22:18:41 +00:00
* Remove double encoding in MathML via Unicode MathML spaces We used to have a complex mechanic for escaping strings, marking them as `needsEscape = false`, and then not escaping those strings (for combining strings in `\operatorname`). But this doesn't really work with `render`ing directly to a node, as `document.createTextNode` can't be stopped from escaping. I've thus removed this mechanic, which required the following changes: * Switch MathML "smart space" encoding to use Unicode instead of `&LongNames;` (which weren't working with `render` for the same reason). * Hack our HTML/MathML serializer to not use `String.trim`, which wrecks havoc with emitted Unicode spaces. Now `toText()` doesn't escape, so strings concatenate in unescaped form, and `toHTML()` only does the necessary escaping. Thus fix #1782. * Fix src/utils.js Co-Authored-By: edemaine <edemaine@mit.edu> * Fix src/mathMLTree.js documentation Co-Authored-By: edemaine <edemaine@mit.edu> * Remove trim hack thanks to diffable-html@4.0.0 * Switch back to jest-serializer-html * Update mathMLTree.js