Ticket #7742: 7742.patch

File 7742.patch, 1.1 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/selection/plugin.js

     
    7878                                        && node.getName() in CKEDITOR.dtd.$removeEmpty;
    7979                }
    8080
     81                function singletonBlock( node )
     82                {
     83                        var body = range.document.getBody();
     84                        return !node.is( 'body' ) && body.getChildCount() == 1;
     85                }
     86
    8187                var start = range.startContainer,
    8288                        offset = range.startOffset;
    8389
     
    8692
    8793                // 1. Empty inline element. <span>^</span>
    8894                // 2. Adjoin to inline element. <p><strong>text</strong>^</p>
    89                 return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) );
     95                // 3. The only empty block in document. <body><p>^</p></body> (#7222)
     96                return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) || singletonBlock( start )
     97                                : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) );
    9098        }
    9199
    92100        var selectAllCmd =
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy