MCPcopy Create free account
hub / github.com/TruthHun/BookStack / renderError

Function renderError

static/katex/katex.mjs:15993–16002  ·  view source on GitHub ↗
(error, expression, options)

Source from the content-addressed store, hash-verified

15991
15992
15993const renderError = function renderError(error, expression, options) {
15994 if (options.throwOnError || !(error instanceof ParseError)) {
15995 throw error;
15996 }
15997
15998 const node = buildCommon.makeSpan(["katex-error"], [new SymbolNode(expression)]);
15999 node.setAttribute("title", error.toString());
16000 node.setAttribute("style", `color:${options.errorColor}`);
16001 return node;
16002};
16003/**
16004 * Generates and returns the katex build tree. This is used for advanced
16005 * use cases (like rendering to custom output).

Callers 2

renderToDomTreeFunction · 0.85
renderToHTMLTreeFunction · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected