mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 15:36:52 +00:00
Fixed problem with static generation of KaTeX in the browser
This commit is contained in:
parent
18e38bb2bc
commit
f8027a3708
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user