mirror of
https://github.com/discourse/discourse-math.git
synced 2025-07-04 21:02:21 +00:00
don't decorate non math
This commit is contained in:
parent
669f756b34
commit
0329745f84
@ -8,7 +8,7 @@ function initMathJax() {
|
|||||||
if (initializedMathJax) { return; }
|
if (initializedMathJax) { return; }
|
||||||
|
|
||||||
var extensions = ["toMathML.js", "Safe.js"];
|
var extensions = ["toMathML.js", "Safe.js"];
|
||||||
|
|
||||||
if (enable_accessibility) {
|
if (enable_accessibility) {
|
||||||
extensions.push("[a11y]/accessibility-menu.js");
|
extensions.push("[a11y]/accessibility-menu.js");
|
||||||
}
|
}
|
||||||
@ -65,6 +65,11 @@ function decorate(elem, isPreview){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mathjax($elem) {
|
function mathjax($elem) {
|
||||||
|
|
||||||
|
if (!$elem || !$elem.find) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const mathElems = $elem.find('.math');
|
const mathElems = $elem.find('.math');
|
||||||
|
|
||||||
if (mathElems.length > 0) {
|
if (mathElems.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user