Ticket #3473: 3473_6.patch

File 3473_6.patch, 1.9 KB (added by Garry Yao, 15 years ago)
  • _source/core/dom/element.js

     
    241241                        // Ignore empty/spaces text.
    242242                        while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim( lastChild.getText() ) )
    243243                                lastChild = lastChild.getPrevious();
    244 
    245                         if ( !lastChild || ( lastChild.is && ( !lastChild.is( 'br' ) || !lastChild.getAttribute( '_cke_bogus' ) ) ) )
     244                        if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) )
    246245                        {
    247246                                this.append(
    248247                                        CKEDITOR.env.opera ?
    249248                                                this.getDocument().createText('') :
    250                                                 this.getDocument().createElement( 'br', { attributes : { _cke_bogus : 1 } } ) );
     249                                                this.getDocument().createElement( 'br' ) );
    251250                        }
    252251                },
    253252
  • _source/plugins/enterkey/plugin.js

     
    259259                        range.insertNode( lineBreak );
    260260
    261261                        // A text node is required by Gecko only to make the cursor blink.
     262                        // We need some text inside of it, so the bogus <br> is properly
     263                        // created.
    262264                        if ( CKEDITOR.env.gecko )
    263                                 doc.createText( '' ).insertAfter( lineBreak );
     265                                doc.createText( '\ufeff' ).insertAfter( lineBreak );
    264266
    265267                        // If we are at the end of a block, we must be sure the bogus node is available in that block.
    266268                        if ( isEndOfBlock && !CKEDITOR.env.ie )
    267269                                lineBreak.getParent().appendBogus();
    268270
     271                        // Now we can remove the text node contents, so the caret doesn't
     272                        // stop on it.
     273                        if ( CKEDITOR.env.gecko )
     274                                lineBreak.getNext().$.nodeValue = '';
     275
    269276                        // IE has different behavior regarding position.
    270277                        if ( CKEDITOR.env.ie )
    271278                                range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy