Scratch page for testing!
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/support/parse.ts b/src/support/parse.ts
index 6dfdae2..4245dc2 100644
--- a/src/support/parse.ts
+++ b/src/support/parse.ts
@@ -300,6 +300,16 @@ export class MathStatement {
return node
}
+ /** Returns true if the expression is valid. */
+ isValid(): boolean {
+ try {
+ this.toHTMLString()
+ return true
+ } catch (_) {
+ return false
+ }
+ }
+
/** Get all symbols referenced in this statement. */
symbols(): math.SymbolNode[] {
return (new SymbolWalk()).walk(this.parse())