Add isStyleBlock() to MathCommand API
isStyleBlock() indicates whether a MathCommand is used for applying
styles to a set of blocks rather than contributing to the structure or
content of the math to be rendered. Returns false by default. TextColor
and Class blocks return true.
diff --git a/src/commands/math.js b/src/commands/math.js
index 63341e3..6d20c7d 100644
--- a/src/commands/math.js
+++ b/src/commands/math.js
@@ -52,6 +52,9 @@
return isEmpty && child.isEmpty();
});
};
+ _.isStyleBlock = function() {
+ return false;
+ };
_.parser = function() {
var block = latexMathParser.block;
diff --git a/src/commands/math/commands.js b/src/commands/math/commands.js
index 51e712a..fdd3cf2 100644
--- a/src/commands/math/commands.js
+++ b/src/commands/math/commands.js
@@ -114,6 +114,9 @@
})
;
};
+ _.isStyleBlock = function() {
+ return true;
+ };
});
// Very similar to the \textcolor command, but will add the given CSS class.
@@ -133,6 +136,9 @@
})
;
};
+ _.isStyleBlock = function() {
+ return true;
+ };
});
var SupSub = P(MathCommand, function(_, super_) {