Ticket #5789: 5789.patch

File 5789.patch, 1.9 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/htmlwriter/plugin.js

     
    9999                // Disable indentation on <pre>.
    100100                this.setRules( 'pre',
    101101                        {
    102                           indent: false
     102                                indent: false,
     103                                breakAfterOpen : false
    103104                        });
    104105        },
    105106
  • _source/plugins/wysiwygarea/plugin.js

     
    719719                                                                                '</html>';
    720720                                                                }
    721721
     722                                                                // Compensate one leading line break for <pre> as browsers
     723                                                                // are ignoring the first line-break in front of it. (#5789)
     724                                                                data = data.replace( /(<pre>)(\r\n|\n)/g, '$1$2$2' );
    722725                                                                data += activationScript;
    723726
    724727
  • _source/plugins/htmldataprocessor/plugin.js

     
    302302                return html.replace( protectSelfClosingRegex, '<cke:$1$2></cke:$1>' );
    303303        }
    304304
     305        function protectPreFormatted( html )
     306        {
     307                return html.replace( /(<pre>)(\r\n|\n)/g, '$1$2$2' );
     308        }
     309
    305310        function protectRealComments( html )
    306311        {
    307312                return html.replace( /<!--(?!{cke_protected})[\s\S]+?-->/g, function( match )
     
    422427                        // protecting them into open-close. (#3591)
    423428                        data = protectSelfClosingElements( data );
    424429
     430                        // Compensate one leading line break for <pre> as browsers
     431                        // are ignoring the first line-break in front of it. (#5789)
     432                        data = protectPreFormatted( data );
     433
    425434                        // Call the browser to help us fixing a possibly invalid HTML
    426435                        // structure.
    427436                        var div = new CKEDITOR.dom.element( 'div' );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy