mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 17:00:10 +00:00
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:
parent
848f87626c
commit
a25f1e329c
|
@ -116,7 +116,7 @@ Ref.prototype.handleRef = function ( manager, pipelineOpts, refTok, cb ) {
|
||||||
parentCB: cb,
|
parentCB: cb,
|
||||||
emptyContentCB: finalCB,
|
emptyContentCB: finalCB,
|
||||||
documentCB: function(refContentDoc) {
|
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]) {
|
if (!this.nestedRefsHTMLMap[referencesAboutId]) {
|
||||||
this.nestedRefsHTMLMap[referencesAboutId] = ["\n"];
|
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.
|
// This effectively ignores content from later references with the same name.
|
||||||
|
|
Loading…
Reference in a new issue