/*! * VisualEditor DataModel MediaWiki example data sets. * * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * @class * @singleton * @ignore */ ve.dm.mwExample = {}; ve.dm.mwExample.createExampleDocument = function ( name, store ) { return ve.dm.example.createExampleDocumentFromObject( name, store, ve.dm.mwExample ); }; ve.dm.mwExample.MWInlineImageHtml = ''; ve.dm.mwExample.MWTransclusion = { 'blockOpen': '
', 'blockOpenModified': '
', 'blockContent': '

Hello, world!

', 'inlineOpen': '', 'inlineOpenModified': '', 'inlineContent': '$1,234.00', 'inlineClose': '', 'mixed': 'Foo', 'pairOne': '

foo

', 'pairTwo': '

foo

', 'meta': '' + '\n' + '' }; ve.dm.mwExample.MWTransclusion.blockData = { 'type': 'mwTransclusionBlock', 'attributes': { 'mw': { 'id': 'mwt1', 'target': { 'wt' : 'Test' }, 'params': { '1': { 'wt': 'Hello, world!' } } }, 'originalDomElements': $( ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent ).toArray(), 'originalMw': '{\"target\":{\"wt\":\"Test\"},\"params\":{\"1\":{\"wt\":\"Hello, world!\"}},\"id\":\"mwt1\"}', 'originalIndex': 0 }, 'htmlAttributes': [ { 'values': { 'about': '#mwt1', 'data-mw': '{\"target\":{\"wt\":\"Test\"},\"params\":{\"1\":{\"wt\":\"Hello, world!\"}},\"id\":\"mwt1\"}', 'data-parsoid': '{\"tsr\":[18,40],\"src\":\"{{Test|Hello, world!}}\",\"dsr\":[18,40,null,null]}', 'typeof': 'mw:Transclusion' } }, { 'values': { 'about': '#mwt1', 'data-parsoid': '{}' } } ] }; ve.dm.mwExample.MWTransclusion.inlineData = { 'type': 'mwTransclusionInline', 'attributes': { 'mw': { 'id': 'mwt1', 'target': { 'wt' : 'Inline' }, 'params': { '1': { 'wt': '1,234' } } }, 'originalDomElements': $( ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose ).toArray(), 'originalMw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"1,234\"}}}', 'originalIndex': 0 }, 'htmlAttributes': [ { 'values': { '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:Transclusion' } } ] }; ve.dm.mwExample.MWTransclusion.mixedDataOpen = { 'type': 'mwTransclusionInline', 'attributes': { 'mw': { 'id': 'mwt1', 'target': { 'wt': 'Inline' }, 'params': { '1': { 'wt': '5,678' } } }, 'originalDomElements': $( ve.dm.mwExample.MWTransclusion.mixed ).toArray(), 'originalMw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"5,678\"}}}', 'originalIndex': 0 }, 'htmlAttributes': [ { 'values': { 'about': '#mwt1', 'rel': 'mw:WikiLink/Category', 'typeof': 'mw:Transclusion', 'data-mw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"5,678\"}}}' } }, { 'values': { 'about': '#mwt1' } } ] }; ve.dm.mwExample.MWTransclusion.mixedDataClose = { 'type': '/mwTransclusionInline' }; ve.dm.mwExample.MWTransclusion.blockParamsHash = ve.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.blockData ), undefined ] ); ve.dm.mwExample.MWTransclusion.blockStoreItems = { 'hash': ve.dm.mwExample.MWTransclusion.blockParamsHash, 'value': $( ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent ).toArray() }; ve.dm.mwExample.MWTransclusion.inlineParamsHash = ve.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.inlineData ), undefined ] ); ve.dm.mwExample.MWTransclusion.inlineStoreItems = { 'hash': ve.dm.mwExample.MWTransclusion.inlineParamsHash, 'value': $( ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose ).toArray() }; ve.dm.mwExample.MWTransclusion.mixedParamsHash = ve.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.mixedDataOpen ), undefined ] ); ve.dm.mwExample.MWTransclusion.mixedStoreItems = { 'hash': ve.dm.mwExample.MWTransclusion.mixedParamsHash, 'value': $( ve.dm.mwExample.MWTransclusion.mixed ).toArray() }; ve.dm.mwExample.MWReference = { 'referenceList': '
    ' }; ve.dm.mwExample.mwNowikiAnnotation = { 'type': 'mwNowiki', 'attributes': { 'originalDomElements': $( '[[Bar]]' ).toArray() }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Nowiki' } } ] }; ve.dm.mwExample.mwNowiki = [ { 'type': 'paragraph' }, 'F', 'o', 'o', [ '[', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ '[', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ 'B', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ 'a', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ 'r', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ ']', [ ve.dm.mwExample.mwNowikiAnnotation ] ], [ ']', [ ve.dm.mwExample.mwNowikiAnnotation ] ], 'B', 'a', 'z', { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ]; ve.dm.mwExample.mwNowikiHtml = '

    Foo[[Bar]]Baz

    '; ve.dm.mwExample.withMeta = [ { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/alienMeta' }, { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/mwAlienMeta' }, { 'type': 'paragraph' }, 'F', 'o', 'o', { 'type': 'mwCategory', 'attributes': { 'hrefPrefix': './', 'category': 'Category:Bar', 'origCategory': 'Category:Bar', 'sortkey': '', 'origSortkey': '' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:WikiLink/Category', 'href': './Category:Bar' } } ] }, { 'type': '/mwCategory' }, 'B', 'a', 'r', { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/mwAlienMeta' }, 'B', 'a', { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/alienMeta' }, 'z', { 'type': '/paragraph' }, { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/mwAlienMeta' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/alienMeta' }, { 'type': 'mwCategory', 'attributes': { 'hrefPrefix': './', 'category': 'Category:Foo foo', 'origCategory': 'Category:Foo_foo', 'sortkey': 'Bar baz#quux', 'origSortkey': 'Bar baz%23quux' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:WikiLink/Category', 'href': './Category:Foo_foo#Bar baz%23quux' } } ] }, { 'type': '/mwCategory' }, { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/mwAlienMeta' }, { 'type': 'internalList' }, { 'type': '/internalList' } ]; ve.dm.mwExample.withMetaPlainData = [ { 'type': 'paragraph' }, 'F', 'o', 'o', 'B', 'a', 'r', 'B', 'a', 'z', { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ]; ve.dm.mwExample.withMetaMetaData = [ [ { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } } ], undefined, undefined, undefined, [ { 'type': 'mwCategory', 'attributes': { 'hrefPrefix': './', 'category': 'Category:Bar', 'origCategory': 'Category:Bar', 'sortkey': '', 'origSortkey': '' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:WikiLink/Category', 'href': './Category:Bar' } } ] } ], undefined, undefined, [ { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } } ], undefined, [ { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } } ], undefined, [ { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': 'mwCategory', 'attributes': { 'hrefPrefix': './', 'category': 'Category:Foo foo', 'origCategory': 'Category:Foo_foo', 'sortkey': 'Bar baz#quux', 'origSortkey': 'Bar baz%23quux' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:WikiLink/Category', 'href': './Category:Foo_foo#Bar baz%23quux' } } ] }, { 'type': 'mwAlienMeta', 'attributes': { 'domElements': $( '' ).toArray() } } ], undefined, undefined ]; ve.dm.mwExample.references = [ { 'type': 'paragraph' }, { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 0, 'listKey': 'auto/0', 'mw': { 'attrs': {}, 'body': { 'html': 'No name 1' }, 'name': 'ref' }, 'originalMw': '{"name":"ref","body":{"html":"No name 1"},"attrs":{}}', 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt2', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"No name 1"},"attrs":{}}', 'data-parsoid': '{"src":"No name 1","dsr":[0,20,5,6]}', 'id': 'cite_ref-1-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': 'paragraph', 'htmlAttributes': [ { 'values': { 'data-parsoid': '{"dsr":[22,108,0,0]}' } } ] }, 'F', 'o', 'o', { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 1, 'listKey': 'literal/bar', 'mw': { 'attrs': { 'name': 'bar' }, 'body': { 'html': 'Bar' }, 'name': 'ref' }, 'originalMw': '{"body":{"html":""},"attrs":{"name":"bar"}}', 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt6', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Bar"},"attrs":{"name":"bar"}}', 'data-parsoid': '{"src":"Bar","dsr":[25,50,16,6]}', 'id': 'cite_ref-bar-2-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'B', 'a', 'z', { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 2, 'listKey': 'literal/:3', 'mw': { 'attrs': { 'name': ':3' }, 'body': { 'html': 'Quux' }, 'name': 'ref' }, 'originalMw': '{"name":"ref","body":{"html":"Quux"},"attrs":{"name":":3"}}', 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt7', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Quux"},"attrs":{"name":"quux"}}', 'data-parsoid': '{"src":"Quux","dsr":[54,81,17,6]}', 'id': 'cite_ref-quux-3-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'W', 'h', 'e', 'e', { 'type': 'mwReference', 'attributes': { 'contentsUsed': false, 'listGroup': 'mwReference/', 'listIndex': 1, 'listKey': 'literal/bar', 'mw': { 'attrs': { 'name': 'bar' }, 'name': 'ref' }, 'originalMw': '{"body":{"html":""},"attrs":{"name":"bar"}}', 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt8', 'class': 'reference', 'data-mw': '{"name":"ref","attrs":{"name":"bar"}}', 'data-parsoid': '{"src":"","dsr":[86,104,18,0]}', 'id': 'cite_ref-bar-2-1', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'Y', 'a', 'y', { 'type': '/paragraph' }, { 'type': 'paragraph' }, { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 3, 'listKey': 'auto/1', 'mw': { 'attrs': {}, 'body': { 'html': 'No name 2' }, 'name': 'ref' }, 'originalMw': '{"name":"ref","body":{"html":"No name 2"},"attrs":{}}', 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt11', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"No name 2"},"attrs":{}}', 'data-parsoid': '{"src":"No name 2","dsr":[110,130,5,6]}', 'id': 'cite_ref-4-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/foo', 'listIndex': 4, 'listKey': 'auto/2', 'mw': { 'attrs': { 'group': 'foo' }, 'body': { 'html': 'No name 3' }, 'name': 'ref' }, 'originalMw': '{"name":"ref","body":{"html":"No name 3"},"attrs":{"group":"foo"}}', 'refGroup': 'foo' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt12', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"No name 3"},"attrs":{}}', 'data-parsoid': '{"src":"No name 3"', 'id': 'cite_ref-5-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': 'mwReferenceList', 'attributes': { 'mw': { 'name': 'references', 'attrs': {} }, 'originalMw': '{"name":"references","attrs":{}"}', //'domElements': HTML, 'listGroup': 'mwReference/', 'refGroup': '' } }, { 'type': '/mwReferenceList' }, { 'type': 'internalList' }, { 'type': 'internalItem' }, { 'type': 'paragraph' }, 'N', 'o', ' ', 'n', 'a', 'm', 'e', ' ', '1', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type': 'paragraph' }, 'B', 'a', 'r', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type' : 'paragraph' }, 'Q', 'u', 'u', 'x', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type' : 'paragraph' }, 'N', 'o', ' ', 'n', 'a', 'm', 'e', ' ', '2', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type' : 'paragraph' }, 'N', 'o', ' ', 'n', 'a', 'm', 'e', ' ', '3', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': '/internalList' } ]; ve.dm.mwExample.complexInternalData = [ { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': 'paragraph' }, 'F', ['o', [ve.dm.example.bold]], ['o', [ve.dm.example.italic]], { 'type': 'mwReference', 'attributes': { 'mw': {}, 'about': '#mwt1', 'listIndex': 0, 'listGroup': 'mwReference/', 'listKey': null, 'refGroup': '', 'contentsUsed': true } }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': 'internalList' }, { 'type': 'internalItem' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'R', ['e', [ve.dm.example.bold]], 'f', { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, 'e', ['r', [ve.dm.example.italic]], ['e', [ve.dm.example.italic]], { 'type': 'mwReference', 'attributes': { 'mw': {}, 'about': '#mwt2', 'listIndex': 1, 'listGroup': 'mwReference/', 'listKey': 'foo', 'refGroup': '', 'contentsUsed': true } }, { 'type': '/mwReference' }, 'n', 'c', 'e', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': 'preformatted' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': 'mwEntity', 'attributes': { 'character': '€' } }, { 'type': '/mwEntity' }, '2', '5', '0', { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': '/preformatted' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).get() } }, { 'type': '/alienMeta' }, { 'type': '/internalItem' }, { 'type': '/internalList' } ]; ve.dm.mwExample.complexInternalData.internalItems = [ { 'group': 'mwReference', 'key': null, 'body': 'First reference' }, { 'group': 'mwReference', 'key': 'foo', 'body': 'Table in ref:
    because I can
    ' } ]; ve.dm.mwExample.domToDataCases = { 'adjacent annotations': { 'html': '' + 'abcd ' + 'ab ' + 'abc' + '', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, [ 'a', [ ve.dm.example.bold ] ], [ 'b', [ { 'type': 'textStyle/bold', 'attributes': { 'nodeName': 'b' }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '1' } } ] } ] ], [ 'c', [ ve.dm.example.bold ] ], [ 'd', [ { 'type': 'textStyle/bold', 'attributes': { 'nodeName': 'b' }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '2' } } ] } ] ], ' ', [ 'a', [ ve.dm.example.bold ] ], [ 'b', [ ve.dm.example.bold ] ], ' ', [ 'a', [ { 'type': 'textStyle/bold', 'attributes': { 'nodeName': 'b' }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '3' } } ] } ] ], [ 'b', [ { 'type': 'textStyle/bold', 'attributes': { 'nodeName': 'b' }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '3' } } ] } ] ], [ 'c', [ { 'type': 'textStyle/bold', 'attributes': { 'nodeName': 'b' }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '4' } } ] } ] ], { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'normalizedHtml': '' + 'abcd ' + 'ab ' + 'abc' + '' }, 'mw:Image': { 'html': '

    ' + ve.dm.mwExample.MWInlineImageHtml + '

    ', 'data': [ { 'type': 'paragraph' }, { 'type': 'mwInlineImage', 'attributes': { 'src': 'http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png', 'href': './File:Wiki.png', 'width': 135, 'height': 155, 'isLinked': true, 'valign': 'text-top', 'resource': './File:Wiki.png', 'type': 'inline', 'originalClasses': 'foo mw-valign-text-top', 'unrecognizedClasses': ['foo'] }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '{\"tsr\":[0,24],\"optList\":[{\"ck\":\"width\",\"ak\":\"500px\"}],\"cacheKey\":\"[[Image:Wiki.png|500px]]\",\"img\":{\"h\":155,\"w\":135,\"wdset\":true},\"dsr\":[0,24,null,null]}' }, 'children': [ { 'values': { 'data-parsoid': '{\"a\":{\"href\":\"./File:Wiki.png\"}}' }, 'children': [ { 'values': { 'data-parsoid': '{\"a\":{\"resource\":\"./File:Wiki.png\",\"width\":\"135\"},\"sa\":{\"resource\":\"Image:Wiki.png\",\"width\":\"500\"}}' } } ] } ] } ] }, { 'type': '/mwInlineImage' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'mw:Transclusion (block level)': { 'html': '' + ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent + '', 'data': [ ve.dm.mwExample.MWTransclusion.blockData, { 'type': '/mwTransclusionBlock' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ ve.dm.mwExample.MWTransclusion.blockStoreItems ], 'normalizedHtml': ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent }, 'mw:Transclusion (block level - modified)': { 'html': '' + ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent + '', 'data': [ ve.dm.mwExample.MWTransclusion.blockData, { 'type': '/mwTransclusionBlock' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ ve.dm.mwExample.MWTransclusion.blockStoreItems ], 'modify': function ( data ) { data[0].attributes.mw.params['1'].wt = 'Hello, globe!'; }, 'normalizedHtml': ve.dm.mwExample.MWTransclusion.blockOpenModified }, 'mw:Transclusion (inline)': { 'html': '' + ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose + '', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, ve.dm.mwExample.MWTransclusion.inlineData, { 'type': '/mwTransclusionInline' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ ve.dm.mwExample.MWTransclusion.inlineStoreItems ], 'normalizedHtml': ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose }, 'mw:Transclusion (inline - modified)': { 'html': '' + ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose + '', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, ve.dm.mwExample.MWTransclusion.inlineData, { 'type': '/mwTransclusionInline' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ ve.dm.mwExample.MWTransclusion.inlineStoreItems ], 'modify': function ( data ) { data[1].attributes.mw.params['1'].wt = '5,678'; }, 'normalizedHtml': ve.dm.mwExample.MWTransclusion.inlineOpenModified + ve.dm.mwExample.MWTransclusion.inlineClose }, 'two mw:Transclusion nodes with identical params but different htmlAttributes': { 'html': '' + ve.dm.mwExample.MWTransclusion.pairOne + ve.dm.mwExample.MWTransclusion.pairTwo + '', 'data': [ { 'type': 'mwTransclusionBlock', 'attributes': { 'mw': { 'params': { '1': { 'wt': 'foo' } } }, 'originalMw': '{"params":{"1":{"wt":"foo"}}}', 'originalDomElements': $( ve.dm.mwExample.MWTransclusion.pairOne ).toArray(), 'originalIndex': 0 }, 'htmlAttributes': [ { 'values': { 'about': '#mwt1', 'data-mw': '{"params":{"1":{"wt":"foo"}}}', 'data-parsoid': '1', 'typeof': 'mw:Transclusion' } } ] }, { 'type': '/mwTransclusionBlock' }, { 'type': 'mwTransclusionBlock', 'attributes': { 'mw': { 'params': { '1': { 'wt': 'foo' } } }, 'originalMw': '{"params":{"1":{"wt":"foo"}}}', 'originalDomElements': $( ve.dm.mwExample.MWTransclusion.pairTwo ).toArray(), 'originalIndex': 0 }, 'htmlAttributes': [ { 'values': { 'about': '#mwt2', 'data-mw': '{"params":{"1":{"wt":"foo"}}}', 'data-parsoid': '2', 'typeof': 'mw:Transclusion' } } ] }, { 'type': '/mwTransclusionBlock' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ { 'hash': '[{"mw":{"params":{"1":{"wt":"foo"}}},"type":"mwTransclusionBlock"},null]', 'value': $( '

    foo

    ' ).toArray() } ] }, 'mw:Transclusion containing only meta data': { 'html': '' + ve.dm.mwExample.MWTransclusion.meta + '', 'data': [ { 'type': 'mwTransclusionMeta', 'attributes': { 'domElements': $( ve.dm.mwExample.MWTransclusion.meta ).toArray() } }, { 'type': '/mwTransclusionMeta' }, { 'type': 'paragraph', 'internal': { 'generated': 'empty' } }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'mw:Reference': { // Wikitext: // Foo BazQuux Whee[[Bar]] YayNo name QuuxDifferent content FooNo name Bar // Ref in refs 'html': '' + '

    Foo' + '' + '[1]' + '' + ' Baz' + '' + '' + ' Whee' + '' + '' + ' Yay' + '' + '' + ' Quux' + '' + '' + ' Foo' + '' + '' + '

    ' + ve.dm.mwExample.MWReference.referenceList + '', 'data': [ { 'type': 'paragraph' }, 'F', 'o', 'o', { 'type': 'mwReference', 'attributes': { 'listIndex': 0, 'listGroup': 'mwReference/', 'listKey': 'literal/bar', 'refGroup': '', 'mw': { 'name': 'ref', 'attrs': { 'name': 'bar' } }, 'originalMw': '{"name":"ref","attrs":{"name":"bar"}}', 'childDomElements': $( '[1]' ).toArray(), 'contentsUsed': false }, 'htmlAttributes': [ { 'values': { 'about': '#mwt1', 'class': 'reference', 'data-mw': '{"name":"ref","attrs":{"name":"bar"}}', 'data-parsoid': '{}', 'id': 'cite_ref-bar-1-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' }, 'children': [ { 'values': { 'href': '#cite_note-bar-1' } } ] } ] }, { 'type': '/mwReference' }, ' ', 'B', 'a', 'z', { 'type': 'mwReference', 'attributes': { 'listIndex': 1, 'listGroup': 'mwReference/g1', 'listKey': 'literal/:0', 'refGroup': 'g1', 'mw': { 'name': 'ref', 'body': { 'html': 'Quux' }, 'attrs': { 'group': 'g1', 'name': ':0' } }, 'originalMw': '{"name":"ref","body":{"html":"Quux"},"attrs":{"group":"g1","name":":0"}}', 'childDomElements': [], 'contentsUsed': true }, 'htmlAttributes': [ { 'values': { 'about': '#mwt2', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Quux"},"attrs":{"group":"g1","name":":0"}}', 'data-parsoid': '{}', 'id': 'cite_ref-quux-2-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'W', 'h', 'e', 'e', { 'type': 'mwReference', 'attributes': { 'listIndex': 0, 'listGroup': 'mwReference/', 'listKey': 'literal/bar', 'refGroup': '', 'mw': { 'name': 'ref', 'body': { 'html': 'Bar' }, 'attrs': { 'name': 'bar' } }, 'originalMw': '{"name":"ref","body":{"html":"Bar"},"attrs":{"name":"bar"}}', 'childDomElements': [], 'contentsUsed': true }, 'htmlAttributes': [ { 'values': { 'about': '#mwt3', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Bar"},"attrs":{"name":"bar"}}', 'data-parsoid': '{}', 'id': 'cite_ref-bar-1-1', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'Y', 'a', 'y', { 'type': 'mwReference', 'attributes': { 'listIndex': 2, 'listGroup': 'mwReference/g1', 'listKey': 'auto/0', 'refGroup': 'g1', 'mw': { 'name': 'ref', 'body': { 'html': 'No name' }, 'attrs': { 'group': 'g1' } }, 'originalMw': '{"name":"ref","body":{"html":"No name"},"attrs":{"group":"g1"}}', 'childDomElements': [], 'contentsUsed': true }, 'htmlAttributes': [ { 'values': { 'about': '#mwt4', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"No name"},"attrs":{"group":"g1"}}', 'data-parsoid': '{}', 'id': 'cite_ref-1-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'Q', 'u', 'u', 'x', { 'type': 'mwReference', 'attributes': { 'listIndex': 0, 'listGroup': 'mwReference/', 'listKey': 'literal/bar', 'refGroup': '', 'mw': { 'name': 'ref', 'body': { 'html': 'Different content' }, 'attrs': { 'name': 'bar' } }, 'originalMw': '{"name":"ref","body":{"html":"Different content"},"attrs":{"name":"bar"}}', 'childDomElements': [], 'contentsUsed': false }, 'htmlAttributes': [ { 'values': { 'about': '#mwt5', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Different content"},"attrs":{"name":"bar"}}', 'data-parsoid': '{}', 'id': 'cite_ref-bar-1-2', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, ' ', 'F', 'o', 'o', { 'type': 'mwReference', 'attributes': { 'listGroup': 'mwReference/', 'listIndex': 3, 'listKey': 'literal/foo', 'refGroup': '', 'mw': { 'name': 'ref', 'attrs': { 'name': 'foo' } }, 'originalMw': '{"name":"ref","attrs":{"name":"foo"}}', 'childDomElements': [], 'contentsUsed': false }, 'htmlAttributes': [ { 'values': { 'about': '#mwt6', 'class': 'reference', 'data-mw': '{"name":"ref","attrs":{"name":"foo"}}', 'data-parsoid': '{}', 'id': 'cite_ref-foo-3-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': 'mwReferenceList', 'attributes': { 'mw': { 'name': 'references', 'attrs': {}, 'body': { 'extsrc': 'Ref in refs', 'html': '[3]' } }, 'originalMw': '{"name":"references","body":{"extsrc":"Ref in refs","html":"[3]"},"attrs":{}}', 'domElements': $( ve.dm.mwExample.MWReference.referenceList ).toArray(), 'listGroup': 'mwReference/', 'refGroup': '' } }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, { 'type': 'mwReference', 'attributes': { 'childDomElements': $( '[3]' ).toArray(), 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 3, 'listKey': 'literal/foo', 'mw': { 'name': 'ref', 'attrs': { 'name': 'foo' }, 'body': { 'html': 'Ref in refs' } }, 'originalMw': '{"name":"ref","body":{"html":"Ref in refs"},"attrs":{"name":"foo"}}', 'refGroup': '' }, 'htmlAttributes': [ { 'children': [ { 'values': { 'href': '#cite_note-foo-3' } } ], 'values': { 'about': '#mwt8', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Ref in refs"},"attrs":{"name":"foo"}}', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' } } ] }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': '/mwReferenceList' }, { 'type': 'internalList' }, { 'type': 'internalItem' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, [ 'B', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink' } } ] } ] ], [ 'a', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink' } } ] } ] ], [ 'r', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink' } } ] } ] ], { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'Q', 'u', 'u', 'x', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'N', 'o', ' ', 'n', 'a', 'm', 'e', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': 'internalItem' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'R', 'e', 'f', ' ', 'i', 'n', ' ', 'r', 'e', 'f', 's', { 'type': '/paragraph' }, { 'type': '/internalItem' }, { 'type': '/internalList' } ] }, 'mw:Reference with metadata': { 'html': '

    ' + '[1]

    ', 'data': [ { 'type': 'paragraph' }, { 'type': 'mwReference', 'attributes': { 'contentsUsed': true, 'listGroup': 'mwReference/', 'listIndex': 0, 'listKey': 'auto/0', 'mw': { 'attrs': {}, 'body': { 'html': 'Foo' }, 'name': 'ref' }, 'originalMw': '{"name":"ref","body":{"html":"Foo"},"attrs":{}}', 'childDomElements': $( '[1]' ).toArray(), 'refGroup': '' }, 'htmlAttributes': [ { 'values': { 'about': '#mwt2', 'class': 'reference', 'data-mw': '{"name":"ref","body":{"html":"Foo"},"attrs":{}}', 'data-parsoid': '{}', 'id': 'cite_ref-1-0', 'rel': 'dc:references', 'typeof': 'mw:Extension/ref' }, 'children': [ { 'values': { 'data-parsoid': '{}', 'href': '#cite_note-bar-1' } } ] } ] }, { 'type': '/mwReference' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': 'internalItem' }, { 'internal': { 'generated': 'wrapper' }, 'type': 'paragraph' }, 'F', 'o', 'o', { 'type': '/paragraph' }, { 'type': 'alienMeta', 'attributes': { 'domElements': $( '' ).toArray() } }, { 'type': '/alienMeta' }, { 'type': '/internalItem' }, { 'type': '/internalList' } ] }, 'internal link with ./ and ../': { 'html': '

    Foo

    ', 'data': [ { 'type': 'paragraph' }, [ 'F', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Foo/Bar', 'origTitle': 'Foo/Bar', 'normalizedTitle': 'Foo/Bar', 'hrefPrefix': './../../../' }, 'htmlAttributes': [ { 'values': { 'href': './../../../Foo/Bar', 'rel': 'mw:WikiLink' } } ] } ] ], [ 'o', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Foo/Bar', 'origTitle': 'Foo/Bar', 'normalizedTitle': 'Foo/Bar', 'hrefPrefix': './../../../' }, 'htmlAttributes': [ { 'values': { 'href': './../../../Foo/Bar', 'rel': 'mw:WikiLink' } } ] } ] ], [ 'o', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Foo/Bar', 'origTitle': 'Foo/Bar', 'normalizedTitle': 'Foo/Bar', 'hrefPrefix': './../../../' }, 'htmlAttributes': [ { 'values': { 'href': './../../../Foo/Bar', 'rel': 'mw:WikiLink' } } ] } ] ], { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'numbered external link': { 'html': '

    [1]

    ', 'data': [ { 'type': 'paragraph' }, [ '[', [ { 'type': 'link/mwExternal', 'attributes': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' }, 'htmlAttributes': [ { 'values': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' } } ] } ] ], [ '1', [ { 'type': 'link/mwExternal', 'attributes': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' }, 'htmlAttributes': [ { 'values': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' } } ] } ] ], [ ']', [ { 'type': 'link/mwExternal', 'attributes': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' }, 'htmlAttributes': [ { 'values': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink/Numbered' } } ] } ] ], { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'URL link': { 'html': '

    mw

    ', 'data': [ { 'type': 'paragraph' }, [ 'm', [ { 'type': 'link/mwExternal', 'attributes': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:ExtLink', 'href': 'http://www.mediawiki.org/' } } ] } ] ], [ 'w', [ { 'type': 'link/mwExternal', 'attributes': { 'href': 'http://www.mediawiki.org/', 'rel': 'mw:ExtLink' }, 'htmlAttributes': [ { 'values': { 'rel': 'mw:ExtLink', 'href': 'http://www.mediawiki.org/' } } ] } ] ], { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'whitespace preservation with wrapped comments and language links': { 'html': 'Foo\n' + '\n' + '', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper', 'whitespace': [ undefined, undefined, undefined, '\n' ] } }, 'F', 'o', 'o', { 'type': '/paragraph' }, { 'type': 'mwLanguage', 'attributes': { 'href': 'http://de.wikipedia.org/wiki/Foo' }, 'htmlAttributes': [ { 'values': { 'href': 'http://de.wikipedia.org/wiki/Foo', 'rel': 'mw:WikiLink/Language' } } ], 'internal': { 'whitespace': [ '\n', undefined, undefined, '\n' ] } }, { 'type': '/mwLanguage' }, { 'type': 'mwLanguage', 'attributes': { 'href': 'http://fr.wikipedia.org/wiki/Foo' }, 'htmlAttributes': [ { 'values': { 'href': 'http://fr.wikipedia.org/wiki/Foo', 'rel': 'mw:WikiLink/Language' } } ], 'internal': { 'whitespace': [ '\n' ] } }, { 'type': '/mwLanguage' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'document with meta elements': { 'html': '

    Foo' + 'Bar' + 'Baz

    ' + '' + '' + '', 'data': ve.dm.mwExample.withMeta }, 'RDFa types spread across two attributes, about grouping is forced': { 'html': '' + ve.dm.mwExample.MWTransclusion.mixed + '', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, ve.dm.mwExample.MWTransclusion.mixedDataOpen, ve.dm.mwExample.MWTransclusion.mixedDataClose, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ], 'storeItems': [ ve.dm.mwExample.MWTransclusion.mixedStoreItems ] }, 'mw:Entity': { 'html': '

    a¢b¥

    ', 'data': [ { 'type': 'paragraph' }, 'a', { 'type': 'mwEntity', 'attributes': { 'character': '¢' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, 'b', { 'type': 'mwEntity', 'attributes': { 'character': '¥' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, { 'type': 'mwEntity', 'attributes': { 'character': '™' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'wrapping with mw:Entity': { 'html': 'a¢b¥', 'data': [ { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'a', { 'type': 'mwEntity', 'attributes': { 'character': '¢' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, 'b', { 'type': 'mwEntity', 'attributes': { 'character': '¥' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, { 'type': 'mwEntity', 'attributes': { 'character': '™' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'whitespace preservation with mw:Entity': { 'html': '

    a b ¥\t

    ', 'data': [ { 'type': 'paragraph', 'internal': { 'whitespace': [ undefined, ' ' ] } }, 'a', ' ', ' ', { 'type': 'mwEntity', 'attributes': { 'character': ' ' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, ' ', ' ', ' ', 'b', ' ', ' ', ' ', ' ', { 'type': 'mwEntity', 'attributes': { 'character': '¥' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, '\t', { 'type': 'mwEntity', 'attributes': { 'character': '™' }, 'htmlAttributes': [ { 'values': { 'typeof': 'mw:Entity' } } ] }, { 'type': '/mwEntity' }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'category default sort key': { 'html': '', 'data': [ { 'type': 'mwDefaultSort', 'attributes': { 'content': 'foo' }, 'htmlAttributes': [ { 'values': { 'content': 'foo', 'property': 'mw:PageProp/categorydefaultsort' } } ] }, { 'type': '/mwDefaultSort' }, { 'type': 'paragraph', 'internal': { 'generated': 'empty' } }, { 'type': '/paragraph' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'thumb image': { 'html': '
    abc
    ', 'data': [ { 'type': 'mwBlockImage', 'attributes': { 'type': 'thumb', 'align': 'right', 'href': 'Foo', 'src': 'Bar', 'width': '1', 'height': '2', 'resource': 'FooBar', 'originalClasses': 'mw-halign-right foobar', 'unrecognizedClasses': ['foobar'] } }, { 'type': 'mwImageCaption' }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper' } }, 'a', 'b', 'c', { 'type': '/paragraph' }, { 'type': '/mwImageCaption' }, { 'type': '/mwBlockImage' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'attribute preservation does not crash due to text node split': { 'html': '' + '
    ' + '' + '' + '' + '
    ' + ' foo bar baz' + '
    ' + '
    ' + '', 'data': [ { 'type': 'mwBlockImage', 'attributes': { 'type': 'thumb', 'align': 'default', 'href': 'Foo', 'src': 'Bar', 'width': '1', 'height': '2', 'resource': 'FooBar', 'originalClasses': undefined, 'unrecognizedClasses': [] }, 'htmlAttributes': [ { 'values': { 'data-parsoid': '{}' }, 'children': [ { 'values': { 'data-parsoid': '{}' }, 'children': [ { 'values': { 'data-parsoid': '{}' } } ] }, { 'values': { 'data-parsoid': '{}' }, 'children': [ { 'values': { 'data-parsoid': '{}' } } ] } ] } ] }, { 'type': 'mwImageCaption', 'internal': { 'whitespace': [ undefined, ' ' ] } }, { 'type': 'paragraph', 'internal': { 'generated': 'wrapper', 'whitespace': [ ' ' ] } }, 'f', 'o', 'o', ' ', [ 'b', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink', 'data-parsoid': '{}' } } ] } ] ], [ 'a', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink', 'data-parsoid': '{}' } } ] } ] ], [ 'r', [ { 'type': 'link/mwInternal', 'attributes': { 'title': 'Bar', 'origTitle': 'Bar', 'normalizedTitle': 'Bar', 'hrefPrefix': './' }, 'htmlAttributes': [ { 'values': { 'href': './Bar', 'rel': 'mw:WikiLink', 'data-parsoid': '{}' } } ] } ] ], ' ', 'b', 'a', 'z', { 'type': '/paragraph' }, { 'type': '/mwImageCaption' }, { 'type': '/mwBlockImage' }, { 'type': 'internalList' }, { 'type': '/internalList' } ] }, 'mw:Nowiki': { 'html': ve.dm.mwExample.mwNowikiHtml, 'data': ve.dm.mwExample.mwNowiki }, 'mw:Nowiki unwraps when text modified': { 'data': ve.dm.mwExample.mwNowiki, 'modify': function ( data ) { data[7][0] = 'z'; }, 'normalizedHtml': '

    Foo[[Bzr]]Baz

    ' }, 'mw:Nowiki unwraps when annotations modified': { 'data': ve.dm.mwExample.mwNowiki, 'modify': function ( data ) { data[7][1].push( ve.dm.example.bold ); }, 'normalizedHtml': '

    Foo[[Bar]]Baz

    ' } };