Commit 5652573d authored by Vanessa's avatar Vanessa

about #12360

parent d2c8588e
......@@ -37,7 +37,6 @@ var Util = {
$(this).find('p').each(function () {
if ($(this).text().indexOf('$/') > -1 || $(this).text().indexOf('$$') > -1) {
hasMathJax = true;
return false;
}
});
if ($(this).find('code.lang-flow, code.language-flow').length > 0) {
......@@ -68,16 +67,15 @@ var Util = {
if (typeof MathJax !== 'undefined') {
initMathJax();
return;
} else {
$.ajax({
method: "GET",
url: "https://cdn.staticfile.org/MathJax/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&_=1473258780393",
dataType: "script"
}).done(function () {
initMathJax();
});
}
$.ajax({
method: "GET",
url: "https://cdn.staticfile.org/MathJax/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&_=1473258780393",
dataType: "script"
}).done(function () {
initMathJax();
});
}
if (hasFlow) {
......@@ -96,15 +94,15 @@ var Util = {
if (typeof (flowchart) !== 'undefined') {
initFlow();
return;
} else {
$.ajax({
method: "GET",
url: latkeConfig.staticServePath + '/js/lib/flowchart/flowchart.min.js',
dataType: "script"
}).done(function () {
initFlow()
});
}
$.ajax({
method: "GET",
url: latkeConfig.staticServePath + '/js/lib/flowchart/flowchart.min.js',
dataType: "script"
}).done(function () {
initFlow()
});
}
},
/**
......
......@@ -1359,23 +1359,23 @@
preview.className += ' editor-preview-active'
}, 1);
toolbar.className += ' active';
var text = cm.getValue();
$.ajax({
url: editor.options.htmlURL,
type: "POST",
cache: false,
data: {
markdownText: text
},
success: function (result, textStatus) {
preview.innerHTML = result.html;
Util.parseMarkdown();
hljs.initHighlighting.called = false;
hljs.initHighlighting();
}
});
}
var text = cm.getValue();
$.ajax({
url: editor.options.htmlURL,
type: "POST",
cache: false,
data: {
markdownText: text
},
success: function (result, textStatus) {
preview.innerHTML = result.html;
hljs.initHighlighting.called = false;
hljs.initHighlighting();
Util.parseMarkdown();
}
});
}
function _replaceSelection (cm, active, start, end) {
......
......@@ -422,7 +422,6 @@ $.extend(Page.prototype, {
} catch (e) {
document.write("<script src=\"" + latkeConfig.staticServePath + "/js/lib/json2.js\"><\/script>");
}
Util.parseMarkdown();
},
/*
* @description 加载随机文章
......
......@@ -39,5 +39,7 @@
"em13Label": "${em13Label}",
"em14Label": "${em14Label}"
};
Util.parseMarkdown();
</script>
${plugins}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment