Added errorHandler Improve MathJax Performance #83

Open
Vinay-Khanagavi wants to merge 2 commits from Vinay-Khanagavi/blender-developer-docs:main into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

View File

@ -8,9 +8,35 @@ window.MathJax = {
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
},
mml: {
output: {
font: "mathjax"
}
},
startup: {
ready() {
MathJax.startup.defaultReady();
MathJax.Config({
showErrorMessages: true,
});
}
},
errorHandler: (errors) => {
console.error("MathJax encountered errors:", errors);
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})
document$.subscribe(debounce(() => {
const mathElements = document.querySelectorAll('.arithmatex');
MathJax.typesetPromise(mathElements);
}, 250));
function debounce(func, wait) {
let timeout;
return function() {
const context = this, args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(context, args), wait);
};
}