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
This commit is contained in:
Emily Eisenberg 2013-07-24 14:49:21 -07:00
parent 138facd785
commit fa101db4e1

View File

@ -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);
};