updated expression.

-removed escaping and reverted back for /
This commit is contained in:
mbrannen 2022-03-07 23:50:05 -07:00
parent 31ea56084e
commit bb6d90fb41

@ -17,7 +17,7 @@ export function expr(
const expr = args.join("");
// Sanitize the math expression
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d\*+.\%]/g, "");
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d*/+.\%]/g, "");
let result;
try {
result = eval(sanitizedExpr);