mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Give TranclusionNodes a matchFunction so they beat LanguageAnnotations"
This commit is contained in:
commit
2582f951af
|
@ -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 ) {
|
||||
|
|
|
@ -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"' +
|
||||
|
|
Loading…
Reference in a new issue