From fa101db4e19cef140f51fda49289bcb4adee135c Mon Sep 17 00:00:00 2001 From: Emily Eisenberg Date: Wed, 24 Jul 2013 14:49:21 -0700 Subject: [PATCH] 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 --- katex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/katex.js b/katex.js index 757b80157..fa2699f13 100644 --- 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); };