From 5bb5cdec050af4c3c4e5e7dddfdc099e6e90c77d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 9 Aug 2024 13:10:30 +1200 Subject: [PATCH] Change replaceAll to use RegEx from string --- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 518b48705..5ffb79f5b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -462,7 +462,7 @@ const replaceVar = function(input, hoist=false, allowUnresolved=false) { mathVars?.forEach((variable)=>{ const foundVar = lookupVar(variable, globalPageNumber, hoist); if(foundVar && foundVar.resolved && foundVar.content && !isNaN(foundVar.content)) // Only subsitute math values if fully resolved, not empty strings, and numbers - replacedLabel = replacedLabel.replaceAll(variable, foundVar.content); + replacedLabel = replacedLabel.replaceAll(new RegExp(`/(?