From 87f5ac9aabfcbe37990efb53674de59002e94ab5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 16 Sep 2017 20:25:26 -0400 Subject: [PATCH 1/3] Add texWithDelims to properties copied, and add translation table so that it becomes just withDelims --- mathjax2/legacy/jax/element/MmlNode.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mathjax2/legacy/jax/element/MmlNode.js b/mathjax2/legacy/jax/element/MmlNode.js index 0fa39e3e0..1da580846 100644 --- a/mathjax2/legacy/jax/element/MmlNode.js +++ b/mathjax2/legacy/jax/element/MmlNode.js @@ -2,6 +2,7 @@ var MML = MathJax.ElementJax.mml; var PROPERTY = [ + 'texWithDelims', 'movesupsub', 'subsupOK', 'primes', @@ -14,6 +15,9 @@ 'variantForm', 'autoOP' ]; + var RENAME = { + texWithDelims: 'withDelims' + }; MML.mbase.Augment({ toMmlNode: function (factory) { @@ -62,7 +66,7 @@ var name = PROPERTY[i]; if (this[name] != null && (this.defaults[name] == null || this.defaults[name] === MML.AUTO)) { - node.setProperty(name, this[name]); + node.setProperty(RENAME[name] || name, this[name]); } } } From 2ec54b954f4880eaa80ed3ded17ce2552183282c Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 18 Sep 2017 06:22:11 -0400 Subject: [PATCH 2/3] Properly handle infered rows added in some cases by TeX input jax that really shouod have been explicit mrows (e.g., in \frac{ab}c). --- mathjax2/legacy/jax/element/MmlNode.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mathjax2/legacy/jax/element/MmlNode.js b/mathjax2/legacy/jax/element/MmlNode.js index 1da580846..e68286d5c 100644 --- a/mathjax2/legacy/jax/element/MmlNode.js +++ b/mathjax2/legacy/jax/element/MmlNode.js @@ -23,14 +23,13 @@ toMmlNode: function (factory) { var kind = this.type; if (kind === 'texatom') kind = 'TeXAtom'; - if (this.inferred) kind = 'inferredMrow'; var node = this.nodeMake(factory, kind); if ("texClass" in this) node.texClass = this.texClass; return node; }, nodeMake: function (factory,kind) { var node = factory.MML[kind](); - var data = (this.data[0] && this.data[0].inferred ? this.data[0].data : this.data); + var data = (this.data[0] && this.data[0].inferred && this.inferRow ? this.data[0].data : this.data); for (var i = 0, m = data.length; i < m; i++) { var child = data[i]; if (child) node.appendChild(child.toMmlNode(factory)); From 3a3f1df48aacb4f8f33e72797d9e7d7e8f9363e6 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 28 Oct 2017 18:09:55 -0400 Subject: [PATCH 3/3] Add fnOP as per Volker's request --- mathjax2/legacy/jax/element/MmlNode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mathjax2/legacy/jax/element/MmlNode.js b/mathjax2/legacy/jax/element/MmlNode.js index e68286d5c..2674677ce 100644 --- a/mathjax2/legacy/jax/element/MmlNode.js +++ b/mathjax2/legacy/jax/element/MmlNode.js @@ -13,7 +13,8 @@ 'isError', 'multiline', 'variantForm', - 'autoOP' + 'autoOP', + 'fnOP' ]; var RENAME = { texWithDelims: 'withDelims'