0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Don't try to merge <br>s or <img>s etc.

This commit is contained in:
Neil Jenkins 2011-11-02 16:43:42 +11:00
parent 9dcbf45f4a
commit ae09554883
2 changed files with 3 additions and 2 deletions

View file

@ -1002,7 +1002,7 @@ document.addEventListener( 'DOMContentLoaded', function () {
splitTag = nextTag[ tag ],
nodeAfterSplit;
if ( !block || event.shift ) {
if ( !block ) {
range._insertNode( createElement( 'BR' ) );
range.collapse( false );
setSelection( range );

View file

@ -206,7 +206,8 @@ implement( Element, {
while ( l-- ) {
child = children[l];
prev = l && children[ l - 1 ];
if ( l && child.isInline() && child.isLike( prev ) ) {
if ( l && child.isInline() && child.isLike( prev ) &&
!leafNodeNames[ child.nodeName ] ) {
if ( range.startContainer === child ) {
range.startContainer = prev;
range.startOffset += prev.getLength();