Merge pull request #887 from dpvc/issue847

Don't remove entities or newlines from <annotation> elements.
This commit is contained in:
Davide P. Cervone 2014-08-17 15:54:09 -04:00
commit b41981b3b3

View File

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