jenkins-bot has submitted this change and it was merged. Change subject: 'typeof' for templates changed in Parsoid, it is 'Transclusion' now and used to be 'Object/Template' ......................................................................
'typeof' for templates changed in Parsoid, it is 'Transclusion' now and used to be 'Object/Template' Change-Id: Ia5b826bc1a2a648a8e618642697484000b68bfc2 --- M modules/ve/dm/nodes/ve.dm.MWTemplateNode.js M modules/ve/test/dm/ve.dm.example.js 2 files changed, 11 insertions(+), 11 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/dm/nodes/ve.dm.MWTemplateNode.js b/modules/ve/dm/nodes/ve.dm.MWTemplateNode.js index 9e81259..1eb950b 100644 --- a/modules/ve/dm/nodes/ve.dm.MWTemplateNode.js +++ b/modules/ve/dm/nodes/ve.dm.MWTemplateNode.js @@ -38,7 +38,7 @@ ve.dm.MWTemplateNode.static.matchTagNames = null; ve.dm.MWTemplateNode.static.matchRdfaTypes = [ - 'mw:Object/Template', + 'mw:Transclusion', // We're interested in all nodes that have mw:Object/Template, even if they also have other mw: // types. So we match all mw: types, then use a matchFunction to assert that mw:Object/Template // is in there. @@ -46,7 +46,7 @@ ]; ve.dm.MWTemplateNode.static.matchFunction = function ( domElement ) { - return ve.indexOf( 'mw:Object/Template', + return ve.indexOf( 'mw:Transclusion', ( domElement.getAttribute( 'typeof' ) || '' ).split( ' ' ) ) !== -1; }; @@ -86,7 +86,7 @@ span = doc.createElement( 'span' ); // All we need to send back to Parsoid is the original template marker, // with a reconstructed data-mw property. - span.setAttribute( 'typeof', 'mw:Object/Template' ); + span.setAttribute( 'typeof', 'mw:Transclusion' ); span.setAttribute( 'data-mw', JSON.stringify( dataElement.attributes.mw ) ); return [ span ]; } diff --git a/modules/ve/test/dm/ve.dm.example.js b/modules/ve/test/dm/ve.dm.example.js index 5955955..663838a 100644 --- a/modules/ve/test/dm/ve.dm.example.js +++ b/modules/ve/test/dm/ve.dm.example.js @@ -910,8 +910,8 @@ ve.dm.example.MWInlineImageHtml = '<a rel="mw:Image" href="./File:Wiki.png" data-parsoid="{"tsr":[158,216],"src":"[[Image:Wiki.png|500px|thumb|center|Example wiki file]]","optNames":{"width":"$1px"},"dsr":[158,216,null,null]}"><img height="" width="500" src="/index.php?title=Special:FilePath/Wiki.png&width=500" alt="Wiki.png"></a>'; ve.dm.example.MWTemplate = { - 'blockSpan': '<span about="#mwt1" typeof="mw:Object/Template" data-mw="{"id":"mwt1","target":{"wt":"Test"},"params":{"1":{"wt":"Hello, world!"}}}" data-parsoid="{"tsr":[18,40],"src":"{{Test|Hello, world!}}","dsr":[18,40,null,null]}"></span>', - 'blockSpanModified': '<span about="#mwt1" typeof="mw:Object/Template" data-mw="{"id":"mwt1","target":{"wt":"Test"},"params":{"1":{"wt":"Hello, globe!"}}}" data-parsoid="{"tsr":[18,40],"src":"{{Test|Hello, world!}}","dsr":[18,40,null,null]}"></span>', + 'blockSpan': '<span about="#mwt1" typeof="mw:Transclusion" data-mw="{"id":"mwt1","target":{"wt":"Test"},"params":{"1":{"wt":"Hello, world!"}}}" data-parsoid="{"tsr":[18,40],"src":"{{Test|Hello, world!}}","dsr":[18,40,null,null]}"></span>', + 'blockSpanModified': '<span about="#mwt1" typeof="mw:Transclusion" data-mw="{"id":"mwt1","target":{"wt":"Test"},"params":{"1":{"wt":"Hello, globe!"}}}" data-parsoid="{"tsr":[18,40],"src":"{{Test|Hello, world!}}","dsr":[18,40,null,null]}"></span>', 'blockContent': '<p about="#mwt1" data-parsoid="{}">Hello, world!</p>', 'blockData': { 'type': 'mwTemplateBlock', @@ -938,7 +938,7 @@ 'about': '#mwt1', 'data-mw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Test\"},\"params\":{\"1\":{\"wt\":\"Hello, world!\"}}}', 'data-parsoid': '{\"tsr\":[18,40],\"src\":\"{{Test|Hello, world!}}\",\"dsr\":[18,40,null,null]}', - 'typeof': 'mw:Object/Template' + 'typeof': 'mw:Transclusion' } }, { @@ -950,8 +950,8 @@ } ] }, - 'inlineOpen': '<span about="#mwt1" typeof="mw:Object/Template" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"1,234"}}}" data-parsoid="{"tsr":[18,34],"src":"{{Inline|1,234}}","dsr":[18,34,null,null]}">', - 'inlineOpenModified': '<span about="#mwt1" typeof="mw:Object/Template" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"5,678"}}}" data-parsoid="{"tsr":[18,34],"src":"{{Inline|1,234}}","dsr":[18,34,null,null]}">', + 'inlineOpen': '<span about="#mwt1" typeof="mw:Transclusion" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"1,234"}}}" data-parsoid="{"tsr":[18,34],"src":"{{Inline|1,234}}","dsr":[18,34,null,null]}">', + 'inlineOpenModified': '<span about="#mwt1" typeof="mw:Transclusion" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"5,678"}}}" data-parsoid="{"tsr":[18,34],"src":"{{Inline|1,234}}","dsr":[18,34,null,null]}">', 'inlineContent': '$1,234.00', 'inlineClose': '</span>', 'inlineData': { @@ -979,12 +979,12 @@ 'about': '#mwt1', 'data-mw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"1,234\"}}}', 'data-parsoid': '{\"tsr\":[18,34],\"src\":\"{{Inline|1,234}}\",\"dsr\":[18,34,null,null]}', - 'typeof': 'mw:Object/Template' + 'typeof': 'mw:Transclusion' } } ] }, - 'mixed': '<link about="#mwt1" rel="mw:WikiLink/Category" typeof="mw:Object/Template" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"5,678"}}}"><span about="#mwt1">Foo</span>', + 'mixed': '<link about="#mwt1" rel="mw:WikiLink/Category" typeof="mw:Transclusion" data-mw="{"id":"mwt1","target":{"wt":"Inline"},"params":{"1":{"wt":"5,678"}}}"><span about="#mwt1">Foo</span>', 'mixedDataOpen': { 'type': 'mwTemplateInline', 'attributes': { @@ -1009,7 +1009,7 @@ 'values': { 'about': '#mwt1', 'rel': 'mw:WikiLink/Category', - 'typeof': 'mw:Object/Template', + 'typeof': 'mw:Transclusion', 'data-mw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"5,678\"}}}' } }, -- To view, visit https://gerrit.wikimedia.org/r/67169 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5b826bc1a2a648a8e618642697484000b68bfc2 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Inez <i...@wikia-inc.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: GWicke <gwi...@wikimedia.org> Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits