mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "Whitespace between unwrapped inline nodes assigned to paragraph"
This commit is contained in:
commit
ff15fbf21b
|
@ -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();
|
||||
|
|
|
@ -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': [
|
||||
|
|
Loading…
Reference in a new issue