Commits

Brian McKenna committed 8d4eec7

Clean up the MathJaxConfig

  • Participants
  • Parent commits c92b2e3

Comments (0)

Files changed (1)

File src/main/resources/includes/js/MathJaxConfig.js

 (function() {
-    AJS.$("<script type=\"text/x-mathjax-config\">" +
-          "MathJax.Hub.Config({" +
-              "extensions: [\"tex2jax.js\"]," +
-              "\"HTML-CSS\": {" +
-                  "availableFonts: [\"TeX\"]," +
-              "}," +
-              "jax: [\"input/TeX\",\"output/HTML-CSS\"]," +
-              "menuSettings: {" +
-                  "context: \"Browser\"," +
-              "}," +
-              "messageStyle: \"none\","  +
-              "tex2jax: {" +
-                  "ignoreClass: \"\"," +
-                  "inlineMath: [[\"$\",\"$\"],[\"\\\\(\",\"\\\\)\"]]," +
-                  "processClass: \"latex\"," +
-              "}," +
-          "});" +
-      "</script>").prependTo("head");
+    // Adds <script type="text/x-mathjax-config"> configuration settings to the head before MathJax starts
+    AJS.$('script').attr('type', 'text/x-mathjax-config').text([
+        'MathJax.Hub.Config({',
+        '    extensions: ["tex2jax.js"],',
+        '    "HTML-CSS": {',
+        '        availableFonts: ["TeX"]',
+        '    },',
+        '    jax: ["input/TeX", "output/HTML-CSS"],',
+        '    menuSettings: {',
+        '        context: "Browser"',
+        '    },',
+        '    messageStyle: "none",' ,
+        '    tex2jax: {',
+        '        ignoreClass: "",',
+        '        inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],',
+        '        processClass: "latex"',
+        '    }',
+        '});'
+    ].join('\n')).prependTo('head');
 })();