mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
parent
4c63ad696e
commit
1b9606452e
3 changed files with 13 additions and 3 deletions
|
@ -2557,7 +2557,17 @@ var cleanupBRs = function ( root ) {
|
||||||
|
|
||||||
proto._ensureBottomLine = function () {
|
proto._ensureBottomLine = function () {
|
||||||
var body = this._body,
|
var body = this._body,
|
||||||
last = body.lastChild;
|
last;
|
||||||
|
// Safari (+others?) adds white-space text nodes to the end of <body>
|
||||||
|
// for no apparent reason. Remove them, since they're semantically
|
||||||
|
// meaningless.
|
||||||
|
while ( last = body.lastChild ) {
|
||||||
|
if ( last.nodeType === TEXT_NODE && !notWS.test( last.data ) ) {
|
||||||
|
body.removeChild( last );
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( !last || last.nodeName !== this.defaultBlockTag || !isBlock( last ) ) {
|
if ( !last || last.nodeName !== this.defaultBlockTag || !isBlock( last ) ) {
|
||||||
body.appendChild( this.createDefaultBlock() );
|
body.appendChild( this.createDefaultBlock() );
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1467,7 +1467,7 @@ var cleanupBRs = function ( root ) {
|
||||||
|
|
||||||
proto._ensureBottomLine = function () {
|
proto._ensureBottomLine = function () {
|
||||||
var body = this._body,
|
var body = this._body,
|
||||||
last = body.lastChild;
|
last = body.lastElementChild;
|
||||||
if ( !last || last.nodeName !== this.defaultBlockTag || !isBlock( last ) ) {
|
if ( !last || last.nodeName !== this.defaultBlockTag || !isBlock( last ) ) {
|
||||||
body.appendChild( this.createDefaultBlock() );
|
body.appendChild( this.createDefaultBlock() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue