mirror of https://github.com/status-im/codimd.git
Fixed mathjax queue might parse whole page if pass an empty or single item array
This commit is contained in:
parent
daf4c9dcae
commit
fae3c02bb2
|
@ -208,8 +208,13 @@ function finishView(view) {
|
||||||
//mathjax
|
//mathjax
|
||||||
var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray();
|
var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray();
|
||||||
try {
|
try {
|
||||||
MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]);
|
if (mathjaxdivs.length > 1) {
|
||||||
MathJax.Hub.Queue(viewAjaxCallback);
|
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) {}
|
} catch (err) {}
|
||||||
//sequence diagram
|
//sequence diagram
|
||||||
var sequences = view.find(".sequence-diagram.raw").removeClass("raw");
|
var sequences = view.find(".sequence-diagram.raw").removeClass("raw");
|
||||||
|
|
Loading…
Reference in New Issue