mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Opera collapses blocks with just spaces for data
This commit is contained in:
parent
14ee0d0ad5
commit
cfe9bea8b3
1 changed files with 10 additions and 2 deletions
|
@ -385,8 +385,16 @@ implement( Element, {
|
|||
}
|
||||
el = child;
|
||||
}
|
||||
if ( el.isLeaf() && el.nodeType !== TEXT_NODE ) {
|
||||
el.parentNode.insertBefore( doc.createTextNode( '' ), el );
|
||||
if ( el.isLeaf() ) {
|
||||
if ( el.nodeType !== TEXT_NODE ) {
|
||||
el.parentNode.insertBefore(
|
||||
doc.createTextNode( '' ), el );
|
||||
}
|
||||
// Opera will collapse the block element if it contains
|
||||
// just spaces (but not if it contains no data at all).
|
||||
else if ( /^ +$/.test( el.data ) ) {
|
||||
el.data = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( !el.querySelector( 'BR' ) ) {
|
||||
|
|
Loading…
Reference in a new issue