mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Update VE core submodule to master (8434ab8)
New changes: 0bc7034 Fix unmodifiedness test in showSelection 6e27ea1 Test clipboard mode in converter 5481dc5 Localisation updates from https://translatewiki.net. f7623bd ve#resolveUrl: stop accepting string values for base bce9180 ve.ce.FocusableNode: Remove superfluous ve.ce.Surface#appendHighlights call Local changes: * Update test case counter for clipboard tests * Add clipboardBody to tests Change-Id: Ie0f149b74abf10e740be63e3759416ecc8bed656
This commit is contained in:
parent
65d26891ae
commit
66aebc4fb0
2
lib/ve
2
lib/ve
|
@ -1 +1 @@
|
|||
Subproject commit bf202b657cdb96c2bb74935995ab6085302ab450
|
||||
Subproject commit 8434ab8f66f74c3ed304f49742a9d034a7b8666d
|
|
@ -41,7 +41,7 @@ QUnit.test( 'getDomFromModel', function ( assert ) {
|
|||
var msg, caseItem,
|
||||
cases = ve.dm.mwExample.domToDataCases;
|
||||
|
||||
QUnit.expect( 2 * ve.getObjectKeys( cases ).length );
|
||||
QUnit.expect( 3 * ve.getObjectKeys( cases ).length );
|
||||
|
||||
ve.test.utils.modelRegistrySetup();
|
||||
for ( msg in cases ) {
|
||||
|
|
|
@ -32,12 +32,27 @@ ve.dm.mwExample.MWTransclusion = {
|
|||
' data-mw="{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"Hello, world!"}},"i":0}}]}"' +
|
||||
'>' +
|
||||
'</span>',
|
||||
blockOpenClipboard:
|
||||
'<div about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"Hello, world!"}},"i":0}}]}"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'>' +
|
||||
' ' +
|
||||
'</div>',
|
||||
blockOpenFromDataModified:
|
||||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"Hello, globe!"}},"i":0}}]}"' +
|
||||
'>' +
|
||||
'</span>',
|
||||
blockOpenModifiedClipboard:
|
||||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"Hello, globe!"}},"i":0}}]}"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'>' +
|
||||
' ' +
|
||||
'</span>',
|
||||
blockContent: '<p about="#mwt1" data-parsoid="{}">Hello, world!</p>',
|
||||
blockContentClipboard: '<p about="#mwt1" data-parsoid="{}" data-ve-ignore="true">Hello, world!</p>',
|
||||
inlineOpen:
|
||||
'<span about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"1,234"}},"i":0}}]}"' +
|
||||
|
@ -50,10 +65,21 @@ ve.dm.mwExample.MWTransclusion = {
|
|||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"1,234"}},"i":0}}]}"' +
|
||||
'>',
|
||||
inlineOpenClipboard:
|
||||
'<span about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"1,234"}},"i":0}}]}"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'>',
|
||||
inlineOpenFromDataModified:
|
||||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"5,678"}},"i":0}}]}"' +
|
||||
'>',
|
||||
inlineOpenModifiedClipboard:
|
||||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"5,678"}},"i":0}}]}"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'>' +
|
||||
' ',
|
||||
inlineContent: '$1,234.00',
|
||||
inlineClose: '</span>',
|
||||
mixed:
|
||||
|
@ -65,6 +91,12 @@ ve.dm.mwExample.MWTransclusion = {
|
|||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"5,678"}},"i":0}}]}"' +
|
||||
'></span>',
|
||||
mixedClipboard:
|
||||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Inline","href":"./Template:Inline"},"params":{"1":{"wt":"5,678"}},"i":0}}]}"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'> </span>' +
|
||||
'<span about="#mwt1" data-ve-ignore="true">Foo</span>',
|
||||
pairOne:
|
||||
'<p about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}" data-parsoid="1"' +
|
||||
|
@ -77,6 +109,12 @@ ve.dm.mwExample.MWTransclusion = {
|
|||
'<span typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}"' +
|
||||
'></span>',
|
||||
pairClipboard:
|
||||
'<p about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}"' +
|
||||
' data-parsoid="1"' +
|
||||
' data-ve-no-generated-contents="true"' +
|
||||
'>foo</p>',
|
||||
meta:
|
||||
'<link rel="mw:PageProp/Category" href="./Category:Page" about="#mwt1" typeof="mw:Transclusion"' +
|
||||
' data-mw="{"parts":[{"template":{"target":{"wt":"Template:Echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Page]]\\n[[Category:Book]]"}},"i":0}}]}">' +
|
||||
|
@ -861,7 +899,8 @@ ve.dm.mwExample.domToDataCases = {
|
|||
ve.dm.mwExample.MWTransclusion.blockStoreItems
|
||||
],
|
||||
normalizedBody: ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.blockOpenFromData
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.blockOpenFromData,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.blockOpenClipboard + ve.dm.mwExample.MWTransclusion.blockContentClipboard
|
||||
},
|
||||
'mw:Transclusion (block level - modified)': {
|
||||
body: ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent,
|
||||
|
@ -878,7 +917,8 @@ ve.dm.mwExample.domToDataCases = {
|
|||
model.data.data[0].attributes.mw.parts[0].template.params['1'].wt = 'Hello, globe!';
|
||||
},
|
||||
normalizedBody: ve.dm.mwExample.MWTransclusion.blockOpenModified,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.blockOpenFromDataModified
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.blockOpenFromDataModified,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.blockOpenModifiedClipboard
|
||||
},
|
||||
'mw:Transclusion (inline)': {
|
||||
body: ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
|
@ -894,7 +934,8 @@ ve.dm.mwExample.domToDataCases = {
|
|||
ve.dm.mwExample.MWTransclusion.inlineStoreItems
|
||||
],
|
||||
normalizedBody: ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.inlineOpenFromData + ve.dm.mwExample.MWTransclusion.inlineClose
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.inlineOpenFromData + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.inlineOpenClipboard + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose
|
||||
},
|
||||
'mw:Transclusion (inline - modified)': {
|
||||
body: ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
|
@ -913,11 +954,13 @@ ve.dm.mwExample.domToDataCases = {
|
|||
model.data.data[1].attributes.mw.parts[0].template.params['1'].wt = '5,678';
|
||||
},
|
||||
normalizedBody: ve.dm.mwExample.MWTransclusion.inlineOpenModified + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.inlineOpenFromDataModified + ve.dm.mwExample.MWTransclusion.inlineClose
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.inlineOpenFromDataModified + ve.dm.mwExample.MWTransclusion.inlineClose,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.inlineOpenModifiedClipboard + ve.dm.mwExample.MWTransclusion.inlineClose
|
||||
},
|
||||
'two mw:Transclusion nodes with identical params but different htmlAttributes': {
|
||||
body: ve.dm.mwExample.MWTransclusion.pairOne + ve.dm.mwExample.MWTransclusion.pairTwo,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.pairFromData + ve.dm.mwExample.MWTransclusion.pairFromData,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.pairClipboard + ve.dm.mwExample.MWTransclusion.pairClipboard,
|
||||
data: [
|
||||
{
|
||||
type: 'mwTransclusionBlock',
|
||||
|
@ -1266,6 +1309,11 @@ ve.dm.mwExample.domToDataCases = {
|
|||
'data-mw="{"name":"ref","body":' +
|
||||
'{"html":"Foo<!-- bar -->"},"attrs":{}}" ' +
|
||||
'typeof="mw:Extension/ref"></span></p>',
|
||||
clipboardBody: '<p><span typeof="mw:Extension/ref" ' +
|
||||
'data-mw="{"attrs":{},"body":' +
|
||||
'{"html":"Foo<span rel=\\"ve:Comment\\" data-ve-comment=\\" bar \\"></span>"},"name":"ref"}" ' +
|
||||
'>' +
|
||||
'<sup>[1]</sup></span></p>',
|
||||
head: '<base href="http://example.com" />',
|
||||
data: [
|
||||
{ type: 'paragraph' },
|
||||
|
@ -1522,12 +1570,19 @@ ve.dm.mwExample.domToDataCases = {
|
|||
'<meta property="mw:bar" content="baz" /><!--barbaz-->' +
|
||||
'<link rel="mw:PageProp/Category" href="./Category:Foo_foo#Bar baz%23quux" />' +
|
||||
'<meta typeof="mw:Placeholder" data-parsoid="foobar" />',
|
||||
clipboardBody: '<span rel="ve:Comment" data-ve-comment=" No content conversion "></span><meta property="mw:ThisIsAnAlien" /><p>Foo' +
|
||||
'<link rel="mw:PageProp/Category" href="./Category:Bar" />Bar' +
|
||||
'<meta property="mw:foo" content="bar" />Ba<span rel="ve:Comment" data-ve-comment=" inline "></span>z</p>' +
|
||||
'<meta property="mw:bar" content="baz" /><span rel="ve:Comment" data-ve-comment="barbaz"></span>' +
|
||||
'<link rel="mw:PageProp/Category" href="./Category:Foo_foo#Bar baz%23quux" />' +
|
||||
'<meta typeof="mw:Placeholder" data-parsoid="foobar" />',
|
||||
head: '<base href="http://example.com" />',
|
||||
data: ve.dm.mwExample.withMeta
|
||||
},
|
||||
'RDFa types spread across two attributes, about grouping is forced': {
|
||||
body: ve.dm.mwExample.MWTransclusion.mixed,
|
||||
fromDataBody: ve.dm.mwExample.MWTransclusion.mixedFromData,
|
||||
clipboardBody: ve.dm.mwExample.MWTransclusion.mixedClipboard,
|
||||
data: [
|
||||
{ type: 'paragraph', internal: { generated: 'wrapper' } },
|
||||
ve.dm.mwExample.MWTransclusion.mixedDataOpen,
|
||||
|
|
Loading…
Reference in a new issue