From 928c539440fbe2646a9032d81d64beb71e8ba543 Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 1 Apr 2023 21:18:55 +0900 Subject: [PATCH] Fix a bug in macro expander --- packages/client/src/scripts/katex-macro.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/scripts/katex-macro.ts b/packages/client/src/scripts/katex-macro.ts index 4368095be..4c176b296 100644 --- a/packages/client/src/scripts/katex-macro.ts +++ b/packages/client/src/scripts/katex-macro.ts @@ -264,6 +264,8 @@ function expandKaTeXMacroOnce( } } + if (!macros.hasOwnProperty(macroName)) return [fallback, false]; + const numArgs: number = macros[macroName].args; const openBracket: string = macroName.slice(-1);