Move from mathjax to katex

This commit is contained in:
cuom1999 2024-02-05 17:02:49 -06:00
parent b2c9be7bda
commit 08d2437d49
35 changed files with 64 additions and 214 deletions

View file

@ -30,31 +30,7 @@ $(function () {
$(this).attr("src", $(this).attr("data-src"));
})
$preview.addClass('dmmd-preview-has-content').removeClass('dmmd-preview-stale');
var $jax = $content.find('.require-mathjax-support');
if ($jax.length) {
if (!('MathJax' in window)) {
$.ajax({
type: 'GET',
url: $jax.attr('data-config'),
dataType: 'script',
cache: true,
success: function () {
$.ajax({
type: 'GET',
url: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js',
dataType: 'script',
cache: true,
success: function () {
MathJax.typeset();
}
});
}
});
} else {
MathJax.typeset($content[0]);
}
}
renderKatex($content[0]);
});
} else {
$content.empty();