NDOJ/resources/pagedown_math.js
2024-02-19 18:30:39 -06:00

15 lines
No EOL
423 B
JavaScript

function mathjax_pagedown($) {
$.each(window.editors, function (id, editor) {
var preview = $('div.wmd-preview#' + id + '_wmd_preview')[0];
editor.hooks.chain('onPreviewRefresh', function () {
renderKatex(preview);
});
renderKatex(preview);
});
}
window.mathjax_pagedown = mathjax_pagedown;
$(function () {
(mathjax_pagedown)('$' in window ? $ : django.jQuery);
});