mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
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:
parent
cc0bd4b4cc
commit
539a1cab43
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue