Skip to content

Commit 62cdfcf

Browse files
committed
Check for whether MathJax is already loaded before using MathJax variable for AuthorConfig. Resolves issue #671.
1 parent 62a267e commit 62cdfcf

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

unpacked/MathJax.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@
2727
* limitations under the License.
2828
*/
2929

30-
if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}} else {window.MathJax = {}}
31-
32-
// MathJax.isPacked = true; // This line is uncommented by the packer.
3330

31+
//
32+
// Check if browser can support MathJax (no one fails this nowadays)
33+
//
3434
if (document.getElementById && document.childNodes && document.createElement) {
35-
36-
if (!MathJax.Hub) { // skip if already loaded
35+
//
36+
// Skip if MathJax is already loaded
37+
//
38+
if (!(window.MathJax && MathJax.Hub)) {
3739

40+
//
41+
// Get author configuration from MathJax variable, if any
42+
//
43+
if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}}
44+
else {window.MathJax = {}}
45+
46+
// MathJax.isPacked = true; // This line is uncommented by the packer.
47+
3848
MathJax.version = "2.3";
39-
MathJax.fileversion = "2.3";
49+
MathJax.fileversion = "2.3.1";
4050

4151
/**********************************************************/
4252

0 commit comments

Comments
 (0)