mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-23 23:08:41 -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;
|
el = child;
|
||||||
}
|
}
|
||||||
if ( el.isLeaf() && el.nodeType !== TEXT_NODE ) {
|
if ( el.isLeaf() ) {
|
||||||
el.parentNode.insertBefore( doc.createTextNode( '' ), el );
|
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' ) ) {
|
else if ( !el.querySelector( 'BR' ) ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue