commit fa101db4e19cef140f51fda49289bcb4adee135c
parent 138facd7853ba4b444d1893c4244ce8008681a3a
Author: Emily Eisenberg <emily@khanacademy.org>
Date: Wed, 24 Jul 2013 14:49:21 -0700
Make katex always clean up after itself
Summary: This makes it more annoying to use locally, because it goes
away when you type something bad, but is much more useful in use in
khan-exercises and perseus.
Auditors: alpert
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/katex.js b/katex.js
@@ -244,6 +244,7 @@ var clearNode = function(node) {
};
var process = function(toParse, baseNode) {
+ clearNode(baseNode);
var tree = parseTree(toParse);
var style = Style.TEXT;
@@ -251,7 +252,6 @@ var process = function(toParse, baseNode) {
var span = makeSpan(style.cls(), expression);
var katexNode = makeSpan("katex", [span]);
- clearNode(baseNode);
baseNode.appendChild(katexNode);
};