JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / plugins / htmldataprocessor / plugin.js
index c431c03..f8cf91d 100644 (file)
@@ -317,6 +317,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                return html.replace( protectSelfClosingRegex, '<cke:$1$2></cke:$1>' );\r
        }\r
 \r
+       function protectPreFormatted( html )\r
+       {\r
+               return html.replace( /(<pre\b[^>]*>)(\r\n|\n)/g, '$1$2$2' );\r
+       }\r
+\r
        function protectRealComments( html )\r
        {\r
                return html.replace( /<!--(?!{cke_protected})[\s\S]+?-->/g, function( match )\r
@@ -437,6 +442,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        // protecting them into open-close. (#3591)\r
                        data = protectSelfClosingElements( data );\r
 \r
+                       // Compensate one leading line break after <pre> open as browsers\r
+                       // eat it up. (#5789)\r
+                       data = protectPreFormatted( data );\r
+\r
                        // Call the browser to help us fixing a possibly invalid HTML\r
                        // structure.\r
                        var div = new CKEDITOR.dom.element( 'div' );\r
@@ -491,4 +500,3 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  * @example\r
  * config.forceSimpleAmpersand = false;\r
  */\r
-CKEDITOR.config.forceSimpleAmpersand = false;\r