Don't add newlines to text nodes inside lists

Change-Id: Ife11f7b87ab540a8a99f13315f889c2aa41a6a32
This commit is contained in:
Catrope 2012-06-19 11:55:45 -07:00
parent 6bc9b9176a
commit f08c0ca3a0

View file

@ -591,7 +591,10 @@ ve.dm.Converter.prototype.getDomFromData = function( data ) {
.find( '*' )
.contents()
.filter( function() {
return this.nodeType == 3;
// Text nodes only
return this.nodeType == 3 &&
// Exclude text nodes within lists
$( this.parentNode ).closest( 'li, dd, dt' ).length === 0;
} )
.each( function() {
this.data = fixupText( this.data, this.parentNode );