Skip to content

Commit

Permalink
MathJax 2.7.1: Patch clearEnv and array to ensure compatiblity
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Jun 11, 2017
1 parent 9dc90ba commit 08904b7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
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.

10 changes: 10 additions & 0 deletions dist/unpacked/arabic.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,18 @@ 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.
Expand Down
10 changes: 10 additions & 0 deletions src/tex.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,18 @@ 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.
Expand Down

0 comments on commit 08904b7

Please sign in to comment.