Ticket #5766: 5766_2.patch
File 5766_2.patch, 1.3 KB (added by , 13 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
14 14 var nonExitableElementNames = { table:1,pre:1 }; 15 15 16 16 // Matching an empty paragraph at the end of document. 17 var emptyParagraphRegexp = / \s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\1>)?(?=\s*$|<\/body>)/gi;17 var emptyParagraphRegexp = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; 18 18 19 19 var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ); 20 20 … … 896 896 if ( editor.dataProcessor ) 897 897 data = editor.dataProcessor.toDataFormat( data, fixForBody ); 898 898 899 // Strip the last blank paragraph within document.899 // Reset empty if the document contains only one empty paragraph. 900 900 if ( config.ignoreEmptyParagraph ) 901 data = data.replace( emptyParagraphRegexp, '');901 data = data.replace( emptyParagraphRegexp, function( match, lookback ) { return lookback; } ); 902 902 903 903 if ( docType ) 904 904 data = docType + '\n' + data;