diff options
author | Wu Cheng-Han | 2016-11-18 12:19:05 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-11-18 12:19:05 +0800 |
commit | 80ee507951914aef9df62d05d7d482cbb44c4729 (patch) | |
tree | 1b6c59cc45de350e0d03f900134419f2086d40cf | |
parent | f387bb312f70fec6507f11c6aa94615090cac105 (diff) |
Fix mathjax with blockquote might have race condition
-rw-r--r-- | public/js/extra.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index 36d0e676..c0b2e584 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -286,17 +286,6 @@ function finishView(view) { if ($(value).children().length == 0) $(value).gist(viewAjaxCallback); }); - //mathjax - var mathjaxdivs = view.find('span.mathjax.raw').removeClass("raw").toArray(); - try { - if (mathjaxdivs.length > 1) { - MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]); - MathJax.Hub.Queue(viewAjaxCallback); - } else if (mathjaxdivs.length > 0) { - MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs[0]]); - MathJax.Hub.Queue(viewAjaxCallback); - } - } catch (err) {} //sequence diagram var sequences = view.find("div.sequence-diagram.raw").removeClass("raw"); sequences.each(function (key, value) { @@ -508,6 +497,19 @@ function finishView(view) { else langDiv.html(result.value); } }); + //mathjax + var mathjaxdivs = view.find('span.mathjax.raw').removeClass("raw").toArray(); + try { + if (mathjaxdivs.length > 1) { + MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]); + MathJax.Hub.Queue(viewAjaxCallback); + } else if (mathjaxdivs.length > 0) { + MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs[0]]); + MathJax.Hub.Queue(viewAjaxCallback); + } + } catch (err) { + console.warn(err); + } //render title document.title = renderTitle(view); } |