mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Remove autoGenerated hack"
This commit is contained in:
commit
6155cd4434
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue