0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Preserve inline styles on enter in WebKit.

This commit is contained in:
Neil Jenkins 2014-08-28 08:10:31 +07:00
parent da49316876
commit d5e8ef1381
3 changed files with 16 additions and 4 deletions

View file

@ -314,7 +314,13 @@ function fixCursor ( node ) {
} }
if ( isInline( node ) ) { if ( isInline( node ) ) {
if ( !node.firstChild ) { child = node.firstChild;
while ( cantFocusEmptyTextNodes && child &&
child.nodeType === TEXT_NODE && !child.data ) {
node.removeChild( child );
child = node.firstChild;
}
if ( !child ) {
if ( cantFocusEmptyTextNodes ) { if ( cantFocusEmptyTextNodes ) {
fixer = doc.createTextNode( '\u200B' ); fixer = doc.createTextNode( '\u200B' );
if ( win.editor ) { if ( win.editor ) {

File diff suppressed because one or more lines are too long

View file

@ -172,7 +172,13 @@ function fixCursor ( node ) {
} }
if ( isInline( node ) ) { if ( isInline( node ) ) {
if ( !node.firstChild ) { child = node.firstChild;
while ( cantFocusEmptyTextNodes && child &&
child.nodeType === TEXT_NODE && !child.data ) {
node.removeChild( child );
child = node.firstChild;
}
if ( !child ) {
if ( cantFocusEmptyTextNodes ) { if ( cantFocusEmptyTextNodes ) {
fixer = doc.createTextNode( '\u200B' ); fixer = doc.createTextNode( '\u200B' );
if ( win.editor ) { if ( win.editor ) {