mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Add unit test for mwAlienExtension node"
This commit is contained in:
commit
80d8312c28
|
@ -1051,6 +1051,46 @@ ve.dm.mwExample.domToDataCases = {
|
|||
{ type: '/internalList' }
|
||||
]
|
||||
},
|
||||
'mw:AlienExtension': {
|
||||
body:
|
||||
'<div about="#mwt1" typeof="mw:Extension/syntaxhighlight"' +
|
||||
' data-mw="{"name":"syntaxhighlight","attrs":{"lang":"php"},"body":{"extsrc":"\\n$foo = bar;\\n"}}"' +
|
||||
' data-parsoid="1"' +
|
||||
'>' +
|
||||
'<div><span>Rendering</span></div>' +
|
||||
'</div>',
|
||||
normalizedBody:
|
||||
'<div typeof="mw:Extension/syntaxhighlight"' +
|
||||
' data-mw="{"name":"syntaxhighlight","attrs":{"lang":"php5"},"body":{"extsrc":"\\n$foo = bar;\\n"}}"' +
|
||||
' about="#mwt1" data-parsoid="1"' +
|
||||
'>' +
|
||||
'</div>',
|
||||
data: [
|
||||
{
|
||||
type: 'mwAlienExtension',
|
||||
attributes: {
|
||||
mw: {
|
||||
name: 'syntaxhighlight',
|
||||
attrs: {
|
||||
lang: 'php'
|
||||
},
|
||||
body: {
|
||||
extsrc: '\n$foo = bar;\n'
|
||||
}
|
||||
},
|
||||
originalIndex: 0,
|
||||
originalMw: '{"name":"syntaxhighlight","attrs":{"lang":"php"},"body":{"extsrc":"\\n$foo = bar;\\n"}}'
|
||||
},
|
||||
originalDomElements: $( '<div about="#mwt1" data-parsoid="1"></div>' ).toArray()
|
||||
},
|
||||
{ type: '/mwAlienExtension' },
|
||||
{ type: 'internalList' },
|
||||
{ type: '/internalList' }
|
||||
],
|
||||
modify: function ( model ) {
|
||||
model.data.data[0].attributes.mw.attrs.lang = 'php5';
|
||||
}
|
||||
},
|
||||
'mw:Reference': {
|
||||
// Wikitext:
|
||||
// Foo<ref name="bar" /> Baz<ref group="g1" name=":0">Quux</ref> Whee<ref name="bar">[[Bar]]</ref> Yay<ref group="g1">No name</ref> Quux<ref name="bar">Different content</ref> Foo<ref group="g1" name="foo" />
|
||||
|
|
Loading…
Reference in a new issue