Merge "Whitespace between unwrapped inline nodes assigned to paragraph"

This commit is contained in:
jenkins-bot 2013-05-10 17:13:15 +00:00 committed by Gerrit Code Review
commit ff15fbf21b
2 changed files with 38 additions and 0 deletions

View file

@ -590,6 +590,12 @@ ve.dm.Converter.prototype.getDataFromDomRecursion = function ( domElement, wrapp
}
}
// If we're inserting content into a wrapper, any wrappedWhitespace
// up to this point can be considered dealt with
if ( context.inWrapper && childIsContent ) {
wrappedWhitespace = '';
}
// Annotate child
if ( childIsContent && !context.annotations.isEmpty() ) {
childDataElements[0].annotations = context.annotations.getIndexes().slice();

View file

@ -1621,6 +1621,38 @@ ve.dm.example.domToDataCases = {
{ 'type': '/paragraph' }
]
},
'whitespace between unwrapped inline nodes': {
'html':
'<body>' +
'<span typeof="mw:Entity">c</span> <span typeof="mw:Entity">d</span>\n<span typeof="mw:Entity">e</span>' +
'</body>',
'data': [
{
'type': 'paragraph',
'internal': {
'generated': 'wrapper'
}
},
{
'type': 'MWentity',
'attributes': { 'character': 'c', 'html/0/typeof': 'mw:Entity' }
},
{ 'type': '/MWentity' },
' ',
{
'type': 'MWentity',
'attributes': { 'character': 'd', 'html/0/typeof': 'mw:Entity' }
},
{ 'type': '/MWentity' },
'\n',
{
'type': 'MWentity',
'attributes': { 'character': 'e', 'html/0/typeof': 'mw:Entity' }
},
{ 'type': '/MWentity' },
{ 'type': '/paragraph' },
]
},
'whitespace preservation in headings': {
'html': '<body><h2>Foo</h2><h2> Bar</h2><h2>Baz </h2><h2> Quux </h2></body>',
'data': [