diff --git a/katex.js b/katex.js index f9f63efae..34c4d972a 100644 --- a/katex.js +++ b/katex.js @@ -248,7 +248,6 @@ var clearNode = function(node) { }; var process = function(toParse, baseNode) { - clearNode(baseNode); var tree = parseTree(toParse); var style = Style.TEXT; @@ -256,6 +255,7 @@ var process = function(toParse, baseNode) { var span = makeSpan(style.cls(), expression); var katexNode = makeSpan("katex", [span]); + clearNode(baseNode); baseNode.appendChild(katexNode); };