From 8779ee3325927ebf05f556ca766271ffdaf0ba52 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Feb 2024 21:42:03 -0500 Subject: [PATCH] Variable math requires `$` prefix --- 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 79b2c1ce9..09f810907 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -342,7 +342,7 @@ const replaceVar = function(input, hoist=false, allowUnresolved=false) { let replacedLabel = label; - if(mathVars?.[0] !== label.trim()) {// If there was mathy stuff not captured, let's do math! + if(prefix[0] == '$' && mathVars?.[0] !== label.trim()) {// If there was mathy stuff not captured, let's do math! 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