mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix prefix white-space trimmed on paste of plain text.
This commit is contained in:
parent
c190fab9fd
commit
900e43cca8
3 changed files with 5 additions and 11 deletions
|
@ -1832,11 +1832,8 @@ var cleanTree = function cleanTree ( node ) {
|
|||
} else {
|
||||
if ( nodeType === TEXT_NODE ) {
|
||||
data = child.data;
|
||||
// Use \s instead of notWS, because we want to remove nodes
|
||||
// which are just nbsp, in order to cleanup <div>nbsp<br></div>
|
||||
// construct.
|
||||
startsWithWS = /\s/.test( data.charAt( 0 ) );
|
||||
endsWithWS = /\s/.test( data.charAt( data.length - 1 ) );
|
||||
startsWithWS = !notWS.test( data.charAt( 0 ) );
|
||||
endsWithWS = !notWS.test( data.charAt( data.length - 1 ) );
|
||||
if ( !startsWithWS && !endsWithWS ) {
|
||||
continue;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -215,11 +215,8 @@ var cleanTree = function cleanTree ( node ) {
|
|||
} else {
|
||||
if ( nodeType === TEXT_NODE ) {
|
||||
data = child.data;
|
||||
// Use \s instead of notWS, because we want to remove nodes
|
||||
// which are just nbsp, in order to cleanup <div>nbsp<br></div>
|
||||
// construct.
|
||||
startsWithWS = /\s/.test( data.charAt( 0 ) );
|
||||
endsWithWS = /\s/.test( data.charAt( data.length - 1 ) );
|
||||
startsWithWS = !notWS.test( data.charAt( 0 ) );
|
||||
endsWithWS = !notWS.test( data.charAt( data.length - 1 ) );
|
||||
if ( !startsWithWS && !endsWithWS ) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue