Merge "Give TranclusionNodes a matchFunction so they beat LanguageAnnotations"

This commit is contained in:
jenkins-bot 2015-06-24 23:53:32 +00:00 committed by Gerrit Code Review
commit 2582f951af
2 changed files with 26 additions and 0 deletions

View file

@ -52,6 +52,12 @@ ve.dm.MWTransclusionNode.static.matchRdfaTypes = [ 'mw:Transclusion' ];
// Allow all other types (null) so they match to this node.
ve.dm.MWTransclusionNode.static.allowedRdfaTypes = null;
// HACK: This prevents any rules with higher specificity from matching,
// e.g. LanguageAnnotation which uses a match function
ve.dm.MWTransclusionNode.static.matchFunction = function () {
return true;
};
ve.dm.MWTransclusionNode.static.enableAboutGrouping = true;
ve.dm.MWTransclusionNode.static.getHashObject = function ( dataElement ) {

View file

@ -1051,6 +1051,26 @@ ve.dm.mwExample.domToDataCases = {
{ type: '/internalList' }
]
},
'mw:Transclusion which is also a language annotation': {
body: '<span dir="ltr" about="#mwt1" typeof="mw:Transclusion" data-mw="{}">content</span>',
data: [
{ type: 'paragraph', internal: { generated: 'wrapper' } },
{
type: 'mwTransclusionInline',
attributes: {
mw: {},
originalIndex: 0,
originalMw: '{}'
},
originalDomElements: $( '<span dir="ltr" about="#mwt1" typeof="mw:Transclusion" data-mw="{}">content</span>' ).toArray()
},
{ type: '/mwTransclusionInline' },
{ type: '/paragraph' },
{ type: 'internalList' },
{ type: '/internalList' }
],
clipboardBody: '<span dir="ltr" about="#mwt1" typeof="mw:Transclusion" data-mw="{}" data-ve-no-generated-contents="true">content</span>'
},
'mw:AlienBlockExtension': {
body:
'<div about="#mwt1" typeof="mw:Extension/syntaxhighlight"' +