Fix mathjax with blockquote might have race condition
This commit is contained in:
parent
f387bb312f
commit
80ee507951
1 changed files with 13 additions and 11 deletions
|
@ -286,17 +286,6 @@ function finishView(view) {
|
||||||
if ($(value).children().length == 0)
|
if ($(value).children().length == 0)
|
||||||
$(value).gist(viewAjaxCallback);
|
$(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
|
//sequence diagram
|
||||||
var sequences = view.find("div.sequence-diagram.raw").removeClass("raw");
|
var sequences = view.find("div.sequence-diagram.raw").removeClass("raw");
|
||||||
sequences.each(function (key, value) {
|
sequences.each(function (key, value) {
|
||||||
|
@ -508,6 +497,19 @@ function finishView(view) {
|
||||||
else langDiv.html(result.value);
|
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
|
//render title
|
||||||
document.title = renderTitle(view);
|
document.title = renderTitle(view);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue