Merge "Remove autoGenerated hack"

This commit is contained in:
jenkins-bot 2018-02-28 18:41:29 +00:00 committed by Gerrit Code Review
commit 6155cd4434

View file

@ -104,22 +104,14 @@ ve.ce.MWTransclusionNode.static.filterRendering = function ( contentNodes ) {
ve.stripParsoidFallbackIds( wrapper );
contentNodes = Array.prototype.slice.call( wrapper.childNodes );
function isAutoGenerated( node ) {
// Filter out auto-generated items, e.g. reference lists
contentNodes = contentNodes.filter( function ( node ) {
var dataMw = node &&
node.nodeType === Node.ELEMENT_NODE &&
node.hasAttribute( 'data-mw' ) &&
JSON.parse( node.getAttribute( 'data-mw' ) );
return dataMw && dataMw.autoGenerated;
}
// Filter out auto-generated items, e.g. reference lists
contentNodes = contentNodes.filter( function ( node ) {
// HACK: Also check first-child as auto-generated is applied inside ref wrapper (T181230)
if ( isAutoGenerated( node ) || isAutoGenerated( node.childNodes[ 0 ] ) ) {
return false;
}
return true;
return !dataMw || !dataMw.autoGenerated;
} );
function isWhitespaceNode( node ) {