diff --git a/mathjax3-ts/adaptors/lite/Parser.ts b/mathjax3-ts/adaptors/lite/Parser.ts index 8efc37965..872844a46 100644 --- a/mathjax3-ts/adaptors/lite/Parser.ts +++ b/mathjax3-ts/adaptors/lite/Parser.ts @@ -356,6 +356,9 @@ export class LiteParser implements MinDOMParser { * @return {string} The string with " replaced by entities */ public protectAttribute(text: string) { + if (typeof text !== 'string') { + text = String(text); + } return text.replace(/"/, '"'); }