Compare template names when diffing, not just type

As type is always 'mwTransclusionInline/Block'.

Bug: T166801
Change-Id: I76cdf0add780d556206c439797cfcca19133d94d
Depends-On: I0f24d9d81b5491a8f09bc59e5f544f99751fd506
This commit is contained in:
Ed Sanders 2017-07-26 18:20:14 +01:00
parent cc0bd4b4cc
commit 539a1cab43

View file

@ -67,6 +67,17 @@ ve.dm.MWTransclusionNode.static.getHashObject = function ( dataElement ) {
};
};
ve.dm.MWTransclusionNode.static.isDiffComparable = function ( element, other ) {
function getTemplateNames( parts ) {
return parts.map( function ( part ) {
return part.template ? part.template.target.wt : '';
} ).join( '|' );
}
return ve.dm.MWTransclusionNode.super.static.isDiffComparable.call( this, element, other ) &&
getTemplateNames( element.attributes.mw.parts ) === getTemplateNames( other.attributes.mw.parts );
};
/**
* Node type to use when the transclusion is inline
*