From f8027a37080c06bc4ee02295a6dbe4a997417b2b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 14 Jul 2015 08:45:14 +0100 Subject: [PATCH] Fixed problem with static generation of KaTeX in the browser --- plugins/tiddlywiki/katex/wrapper.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/tiddlywiki/katex/wrapper.js b/plugins/tiddlywiki/katex/wrapper.js index 1e91d5223..45822ad81 100644 --- a/plugins/tiddlywiki/katex/wrapper.js +++ b/plugins/tiddlywiki/katex/wrapper.js @@ -36,16 +36,16 @@ KaTeXWidget.prototype.render = function(parent,nextSibling) { var text = this.getAttribute("text",this.parseTreeNode.text || ""); // Render it into a span var span = this.document.createElement("span"); - try { - if($tw.browser) { + // try { + if(!this.document.isTiddlyWikiFakeDom) { katex.render(text,span); } else { span.innerHTML = katex.renderToString(text); } - } catch(ex) { - span.className = "tc-error"; - span.textContent = ex; - } + // } catch(ex) { + // span.className = "tc-error"; + // span.textContent = ex; + // } // Insert it into the DOM parent.insertBefore(span,nextSibling); this.domNodes.push(span);