From c035404555c067ade36214c1f466e2afc7430a8a Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 12 Feb 2024 11:58:56 -0500 Subject: [PATCH] Add exponents via '^' --- 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 04bad652f..6be57096d 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -336,7 +336,7 @@ const replaceVar = function(input, hoist=false) { // Split the string into separate expressions //const variableRegex = /[a-zA-Z_][a-zA-Z0-9_]*(?=\s*(?:[+\-*\/)]|$))/g; - let mathRegex = /[a-z]+\(|[+\-*/()]/g; + let mathRegex = /[a-z]+\(|[+\-*/^()]/g; let matches = label.split(mathRegex) let mathVars = matches.filter(match => isNaN(match))?.map((s)=>s.trim()); // Capture any variable names