Upgrade pagedown

This commit is contained in:
cuom1999 2022-07-15 13:00:34 +07:00
parent ab64ab6134
commit 1ef68e0fdb
8 changed files with 61 additions and 25 deletions

View file

@ -161,15 +161,13 @@
$comments.find('a.edit-link').featherlight({
afterOpen: function () {
register_dmmd_preview($('#id-edit-comment-body-preview'));
if ('DjangoPagedown' in window) {
var $wmd = $('.featherlight .wmd-input');
if ($wmd.length) {
window.DjangoPagedown.createEditor($wmd.get(0));
if ('MathJax' in window) {
var preview = $('.featherlight div.wmd-preview')[0];
window.editors[$wmd.attr('id')].hooks.chain('onPreviewRefresh', function () {
MathJax.Hub.Queue(['Typeset', MathJax.Hub, preview]);
});
MathJax.Hub.Queue(['Typeset', MathJax.Hub, preview]);
}
}