From 68caffca88e7d7fc9b855f04b68315f3a412cca6 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 13 Jun 2026 16:23:33 -0400 Subject: [PATCH] Make sure multi-byte UTF8 characters are handled properly in data-latex attributes. (mathjax/MathJax#3575) --- ts/input/tex/TexParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/input/tex/TexParser.ts b/ts/input/tex/TexParser.ts index 8e4b1603b..67136cba5 100644 --- a/ts/input/tex/TexParser.ts +++ b/ts/input/tex/TexParser.ts @@ -151,7 +151,7 @@ export default class TexParser { // // Back up one to pick up the parsed character (this.i is past it at this point). // - this.saveI = this.i - (kind === 'character' && input[1] !== '&' ? 1 : 0); + this.saveI = this.i - (kind === 'character' && input[1] !== '&' ? input[1].length : 0); const result = this.configuration.handlers.get(kind).parse(input); // // The macro gets processed by the \\ character later