mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Don't trim whitespace if inside another inline node.
This commit is contained in:
parent
aca8fd4fab
commit
34d3839ceb
3 changed files with 11 additions and 1 deletions
|
@ -2460,6 +2460,11 @@ var cleanTree = function ( node, allowStyles ) {
|
|||
// which are just nbsp, in order to cleanup <div>nbsp<br></div>
|
||||
// construct.
|
||||
if ( /\S/.test( data ) ) {
|
||||
// If the parent node is inline, don't trim this node as
|
||||
// it probably isn't at the end of the block.
|
||||
if ( isInline( node ) ) {
|
||||
continue;
|
||||
}
|
||||
j = 0;
|
||||
ll = data.length;
|
||||
if ( !i || !isInline( children[ i - 1 ] ) ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1348,6 +1348,11 @@ var cleanTree = function ( node, allowStyles ) {
|
|||
// which are just nbsp, in order to cleanup <div>nbsp<br></div>
|
||||
// construct.
|
||||
if ( /\S/.test( data ) ) {
|
||||
// If the parent node is inline, don't trim this node as
|
||||
// it probably isn't at the end of the block.
|
||||
if ( isInline( node ) ) {
|
||||
continue;
|
||||
}
|
||||
j = 0;
|
||||
ll = data.length;
|
||||
if ( !i || !isInline( children[ i - 1 ] ) ) {
|
||||
|
|
Loading…
Reference in a new issue