Don't remove entities or newlines from <annotation> elements. Resolves issue #847.

This commit is contained in:
Davide P. Cervone 2014-06-24 17:23:14 -04:00
parent 6912edadbb
commit 44ee2cf762

View File

@ -158,8 +158,12 @@
if (child.nodeName === "#comment") continue; if (child.nodeName === "#comment") continue;
if (child.nodeName === "#text") { if (child.nodeName === "#text") {
if ((mml.isToken || mml.isChars) && !mml.mmlSelfClosing) { if ((mml.isToken || mml.isChars) && !mml.mmlSelfClosing) {
var text = child.nodeValue.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity); var text = child.nodeValue;
mml.Append(MML.chars(this.trimSpace(text))); if (mml.isToken) {
text = text.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity);
text = this.trimSpace(text);
}
mml.Append(MML.chars(text));
} else if (child.nodeValue.match(/\S/)) { } else if (child.nodeValue.match(/\S/)) {
MATHML.Error(["UnexpectedTextNode", MATHML.Error(["UnexpectedTextNode",
"Unexpected text node: %1","'"+child.nodeValue+"'"]); "Unexpected text node: %1","'"+child.nodeValue+"'"]);