Move isStyleBlock to Node
Move isStyleBlock function from MathCommand to Node. Like isEmpty, all
tree elements should inherit this from Node, not just MathCommands.
diff --git a/src/commands/math.js b/src/commands/math.js
index 6d20c7d..63341e3 100644
--- a/src/commands/math.js
+++ b/src/commands/math.js
@@ -52,9 +52,6 @@
return isEmpty && child.isEmpty();
});
};
- _.isStyleBlock = function() {
- return false;
- };
_.parser = function() {
var block = latexMathParser.block;
diff --git a/src/tree.js b/src/tree.js
index 649c517..335dafa 100644
--- a/src/tree.js
+++ b/src/tree.js
@@ -156,6 +156,10 @@
_.isEmpty = function() {
return this.ends[L] === 0 && this.ends[R] === 0;
};
+
+ _.isStyleBlock = function() {
+ return false;
+ };
_.children = function() {
return Fragment(this.ends[L], this.ends[R]);