Merge "Pass full data (including meta) to converter in references"

This commit is contained in:
jenkins-bot 2013-06-24 02:07:01 +00:00 committed by Gerrit Code Review
commit cf062adbfc
2 changed files with 64 additions and 1 deletions

View file

@ -105,7 +105,7 @@ ve.dm.MWReferenceNode.static.toDomElements = function ( dataElement, doc, conver
if ( setContents ) {
converter.getDomSubtreeFromData(
itemNode.getDocument().getData().slice( itemNodeRange.start, itemNodeRange.end ),
itemNode.getDocument().getFullData( new ve.Range( itemNodeRange.start, itemNodeRange.end ), true ),
itemNodeWrapper
),
itemNodeHtml = $( itemNodeWrapper ).html();

View file

@ -1348,6 +1348,69 @@ ve.dm.example.domToDataCases = {
'<li id="cite_note-quux-2"><a href="#cite_ref-quux-2-0">u2191</a>Quux</li>' +
'</ol>'
},
'mw:Reference with metadata': {
'html': '<p><span about="#mwt2" class="reference" ' +
'data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;body&quot;:' +
'{&quot;html&quot;:&quot;Foo<!-- bar -->&quot;},&quot;attrs&quot;:{}}" ' +
'id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid="{}">' +
'</span></p>',
'data': [
{ 'type': 'paragraph' },
{
'type': 'mwReference',
'attributes': {
'about': '#mwt2',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 0,
'listKey': null,
'mw': {
'attrs': {},
'body': {
'html': 'Foo<!-- bar -->'
},
'name': 'ref'
},
'origMw': '{"name":"ref","body":{"html":"Foo<!-- bar -->"},"attrs":{}}',
'refGroup': ''
},
'htmlAttributes': [
{
'values': {
'about': '#mwt2',
'class': 'reference',
'data-mw': '{"name":"ref","body":{"html":"Foo<!-- bar -->"},"attrs":{}}',
'data-parsoid': '{}',
'id': 'cite_ref-1-0',
'rel': 'dc:references',
'typeof': 'mw:Extension/ref'
}
}
]
},
{ 'type': '/mwReference' },
{ 'type': '/paragraph' },
{ 'type': 'internalList' },
{ 'type': 'internalItem' },
{
'internal': {
'generated': 'wrapper'
},
'type': 'paragraph'
},
'F', 'o', 'o',
{ 'type': '/paragraph' },
{
'type': 'alienMeta',
'attributes': {
'domElements': $( '<!-- bar -->' ).toArray()
}
},
{ 'type': '/alienMeta' },
{ 'type': '/internalItem' },
{ 'type': '/internalList' }
]
},
'paragraph with alienInline inside': {
'html': '<body><p>a<tt class="foo">b</tt>c</p></body>',
'data': [