mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-28 02:54:45 +00:00
Error handling for KaTeX plugin
This commit is contained in:
@@ -36,7 +36,12 @@ 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");
|
||||
katex.render(text,span);
|
||||
try {
|
||||
katex.render(text,span);
|
||||
} catch(ex) {
|
||||
span.className = "tc-error";
|
||||
span.textContent = ex;
|
||||
}
|
||||
// Insert it into the DOM
|
||||
parent.insertBefore(span,nextSibling);
|
||||
this.domNodes.push(span);
|
||||
|
||||
Reference in New Issue
Block a user