mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 17:14:27 -05:00
Fixed mathjax queue might parse whole page if pass an empty or single item array
This commit is contained in:
parent
daf4c9dcae
commit
fae3c02bb2
1 changed files with 7 additions and 2 deletions
|
@ -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 {
|
||||||
|
if (mathjaxdivs.length > 1) {
|
||||||
MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]);
|
MathJax.Hub.Queue(["Typeset", MathJax.Hub, mathjaxdivs]);
|
||||||
MathJax.Hub.Queue(viewAjaxCallback);
|
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 a new issue