Ticket #3949: 3949_2.patch

File 3949_2.patch, 2.9 KB (added by Garry Yao, 16 years ago)
  • _source/plugins/enterkey/plugin.js

     
    262262                        // We need some text inside of it, so the bogus <br> is properly
    263263                        // created.
    264264                        if ( !CKEDITOR.env.ie )
     265                        {
    265266                                doc.createText( '\ufeff' ).insertAfter( lineBreak );
    266 
    267                         // If we are at the end of a block, we must be sure the bogus node is available in that block.
    268                         if ( isEndOfBlock && !CKEDITOR.env.ie )
    269                                 lineBreak.getParent().appendBogus();
    270 
    271                         // Now we can remove the text node contents, so the caret doesn't
    272                         // stop on it.
    273                         if ( !CKEDITOR.env.ie )
     267                                // If we are at the end of a block, we must be sure the bogus node is available in that block.
     268                                if ( isEndOfBlock )
     269                                        lineBreak.getParent().appendBogus();
     270                                // Now we can remove the text node contents, so the caret doesn't
     271                                // stop on it.
    274272                                lineBreak.getNext().$.nodeValue = '';
     273                        }
     274                        // IE need to 'refresh' to properly display the line-break in <pre> (#3949).
     275                        else if ( isPre )
     276                        {
     277                                editor.execCommand( 'blur' );
     278                                setTimeout( function(){
     279                                        editor.execCommand( 'blurBack' );
     280                                }, 0 );
     281                        }
     282
    275283                        // IE has different behavior regarding position.
    276284                        if ( CKEDITOR.env.ie )
    277285                                range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );
  • _source/plugins/selection/plugin.js

     
    491491                                                }
    492492
    493493                                                testRange.setEndPoint( 'StartToStart', range );
    494                                                 var distance = testRange.text.length;
     494                                                // IE report line break as CRLF with range.text but
     495                                                // only LF with textnode.nodeValue, normalize them to avoid
     496                                                // breaking character counting logic below. (#3949)
     497                                                var distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length;
    495498
    496499                                                while ( distance > 0 )
    497500                                                        distance -= siblings[ --i ].nodeValue.length;
  • CHANGES.html

     
    130130                <li><a href="http://dev.fckeditor.net/ticket/3742">#3742</a> : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .</li>
    131131                <li><a href="http://dev.fckeditor.net/ticket/3671">#3671</a> : Fixed body fixing should be applied to the real type under fake elements.</li>
    132132                <li><a href="http://dev.fckeditor.net/ticket/3836">#3836</a> : Fixed remove list in enterMode=BR will merge sibling text to one line.</li>
     133                <li><a href="http://dev.fckeditor.net/ticket/3949">#3949</a> : Fixed enterKey within pre-formatted text introduce wrong line-break.</li>
    133134        </ul>
    134135        <h3>
    135136                CKEditor 3.0 RC</h3>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy