www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6a7ac1740f5b939bcd6a8a1297c17f7bfa223555
parent 3cdcd73b01a0a3407586934e3fb63f06d35bc9c3
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Wed,  2 Dec 2015 15:21:24 -0500

Copy empty Presentation MathML elements verbatim rather than inserting <mi> with the name of the element, as neede for Content MathML.  Resolves issue #1323.

Diffstat:
Munpacked/extensions/MathML/content-mathml.js | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/unpacked/extensions/MathML/content-mathml.js b/unpacked/extensions/MathML/content-mathml.js @@ -66,7 +66,7 @@ MathJax.Extension["MathML/content-mathml"] = (function(HUB) { /* mathvariant to use with corresponding <ci> type attribute */ cistyles: { vector: 'bold-italic', - matrix: 'bold-upright' + matrix: 'bold-upright' }, /* Symbol names to translate to characters @@ -208,7 +208,12 @@ MathJax.Extension["MathML/content-mathml"] = (function(HUB) { if (CToP.tokens[contentMMLNode.nodeName]) { CToP.tokens[contentMMLNode.nodeName](parentNode,contentMMLNode,precedence); } else if (contentMMLNode.childNodes.length === 0) { - CToP.appendToken(parentNode,'mi',contentMMLNode.nodeName); + var mml = CToP.MML[contentMMLNode.nodeName]; + if (mml && mml.isa && mml.isa(CToP.mbase)) { + parentNode.appendChild(CToP.cloneNode(contentMMLNode)); + } else { + CToP.appendToken(parentNode,'mi',contentMMLNode.nodeName); + } } else { var clonedChild = CToP.cloneNode(contentMMLNode); parentNode.appendChild(clonedChild); @@ -1712,6 +1717,8 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () { var MATHML = MathJax.InputJax.MathML; var CToP = MathJax.Extension["MathML/content-mathml"]; + CToP.mbase = MathJax.ElementJax.mml.mbase; + CToP.MML = MathJax.ElementJax.mml; MATHML.DOMfilterHooks.Add(function (data) { data.math = CToP.transformElement(data.math);