Skip to content

Commit

Permalink
Merge pull request #12 from Edraak/omar/support-for-mathjax-2.7
Browse files Browse the repository at this point in the history
Support for MathJax 2.7.1 in a hakish way!
  • Loading branch information
OmarIthawi authored Jun 12, 2017
2 parents a5587dd + 9df604f commit 5860249
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/arabic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions dist/unpacked/arabic.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,23 @@ MathJax.Hub.Register.StartupHook('TeX Jax Ready', function () {

var array = TEX.Stack.Item.array;
var arrayClearEnv = array.prototype.clearEnv;
var arrayInit = array.prototype.Init;

array.Augment({
Init: function () {
// Overcome the copyEnv issue that has been introduced in:
// - Pull Request: https://github.com/mathjax/MathJax/pull/1523
//
// Otherwise arrays won't be Arabized.
// - Bug Report: https://groups.google.com/forum/#!topic/mathjax-dev/cWoTKcwMqmY
arrayInit.apply(this, arguments);
this.copyEnv = true;
},
clearEnv: function () {
// Propagate `lang` from Arrays to their children fractions and others.
// This is a bug in the MathJax itself, so this code should be removed once the bug is fixed.
// Follow up on https://github.com/mathjax/MathJax/pull/1523
// It's still not clear how/when a proper solution is possible.
var lang = this.env.lang;

arrayClearEnv.apply(this, arguments);
Expand Down
12 changes: 12 additions & 0 deletions src/tex.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,23 @@ MathJax.Hub.Register.StartupHook('TeX Jax Ready', function () {

var array = TEX.Stack.Item.array;
var arrayClearEnv = array.prototype.clearEnv;
var arrayInit = array.prototype.Init;

array.Augment({
Init: function () {
// Overcome the copyEnv issue that has been introduced in:
// - Pull Request: https://github.com/mathjax/MathJax/pull/1523
//
// Otherwise arrays won't be Arabized.
// - Bug Report: https://groups.google.com/forum/#!topic/mathjax-dev/cWoTKcwMqmY
arrayInit.apply(this, arguments);
this.copyEnv = true;
},
clearEnv: function () {
// Propagate `lang` from Arrays to their children fractions and others.
// This is a bug in the MathJax itself, so this code should be removed once the bug is fixed.
// Follow up on https://github.com/mathjax/MathJax/pull/1523
// It's still not clear how/when a proper solution is possible.
var lang = this.env.lang;

arrayClearEnv.apply(this, arguments);
Expand Down
2 changes: 1 addition & 1 deletion testcases/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if (isLocalDevelopment) {
mathjaxScript = '/mathjax/unpacked/MathJax.js?config=' + mathjaxConfigs;
} else {
mathjaxScript = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=' + mathjaxConfigs;
mathjaxScript = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=' + mathjaxConfigs;
}

var script = document.createElement("script");
Expand Down

0 comments on commit 5860249

Please # to comment.