Upgrade Katex to v0.16.10

This commit is contained in:
Will Faught
2024-04-06 17:58:45 -07:00
parent d0a44bcda1
commit 0e0df96c29
32 changed files with 3806 additions and 3525 deletions

View File

@@ -405,19 +405,20 @@ export default class Parser {
// We treat these similarly to the unicode-math package.
// So we render a string of Unicode (sub|super)scripts the
// same as a (sub|super)script of regular characters.
let str = uSubsAndSups[lex.text];
const isSub = unicodeSubRegEx.test(lex.text);
const subsupTokens = [];
subsupTokens.push(new Token(uSubsAndSups[lex.text]));
this.consume();
// Continue fetching tokens to fill out the string.
while (true) {
const token = this.fetch().text;
if (!(uSubsAndSups[token])) { break; }
if (unicodeSubRegEx.test(token) !== isSub) { break; }
subsupTokens.unshift(new Token(uSubsAndSups[token]));
this.consume();
str += uSubsAndSups[token];
}
// Now create a (sub|super)script.
const body = (new Parser(str, this.settings)).parse();
const body = this.subparse(subsupTokens);
if (isSub) {
subscript = {type: "ordgroup", mode: "math", body};
} else {