Move serializeNode to DOMUtils and use it for data-mw too

* Smaller data-mw with adaptive quoting.
* Updated parserTests with new output
* Also add a serializeChildren method that works similar to innerHTML.
* Move HTML normalization to DOMUtils to avoid cyclic dependencies
* Disable non-IE WS to space normalization pass, needs to be improved. See bug
  55588. This leads to some new passes and some new fails.

Change-Id: I392881bd8a0cfd9f116e70e9a52d1ef14bbd568b
This commit is contained in:
Gabriel Wicke 2013-10-10 10:28:10 -07:00 committed by GWicke
parent 848f87626c
commit a25f1e329c

View file

@ -116,7 +116,7 @@ Ref.prototype.handleRef = function ( manager, pipelineOpts, refTok, cb ) {
parentCB: cb,
emptyContentCB: finalCB,
documentCB: function(refContentDoc) {
finalCB([], refContentDoc.body.innerHTML);
finalCB([], DU.serializeChildren(refContentDoc.body));
}
});
};
@ -412,7 +412,7 @@ References.prototype.extractRefFromNode = function(node) {
if (!this.nestedRefsHTMLMap[referencesAboutId]) {
this.nestedRefsHTMLMap[referencesAboutId] = ["\n"];
}
this.nestedRefsHTMLMap[referencesAboutId].push(span.outerHTML, "\n");
this.nestedRefsHTMLMap[referencesAboutId].push(DU.serializeNode(span), "\n");
}
// This effectively ignores content from later references with the same name.