mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 23:03:15 +00:00
Restore error trapping for KaTeX rendering
This commit is contained in:
parent
69ae017f49
commit
72cf85f0d4
|
@ -36,16 +36,16 @@ KaTeXWidget.prototype.render = function(parent,nextSibling) {
|
||||||
var text = this.getAttribute("text",this.parseTreeNode.text || "");
|
var text = this.getAttribute("text",this.parseTreeNode.text || "");
|
||||||
// Render it into a span
|
// Render it into a span
|
||||||
var span = this.document.createElement("span");
|
var span = this.document.createElement("span");
|
||||||
// try {
|
try {
|
||||||
if(!this.document.isTiddlyWikiFakeDom) {
|
if(!this.document.isTiddlyWikiFakeDom) {
|
||||||
katex.render(text,span);
|
katex.render(text,span);
|
||||||
} else {
|
} else {
|
||||||
span.innerHTML = katex.renderToString(text);
|
span.innerHTML = katex.renderToString(text);
|
||||||
}
|
}
|
||||||
// } catch(ex) {
|
} catch(ex) {
|
||||||
// span.className = "tc-error";
|
span.className = "tc-error";
|
||||||
// span.textContent = ex;
|
span.textContent = ex;
|
||||||
// }
|
}
|
||||||
// Insert it into the DOM
|
// Insert it into the DOM
|
||||||
parent.insertBefore(span,nextSibling);
|
parent.insertBefore(span,nextSibling);
|
||||||
this.domNodes.push(span);
|
this.domNodes.push(span);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user