Ticket #5381: 5381.patch
File 5381.patch, 1.7 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
170 170 } 171 171 } 172 172 173 function isBlankParagraph( block ) 174 { 175 return block.getOuterHtml().match( emptyParagraphRegexp ); 176 } 177 173 178 var isNotWhitespace = CKEDITOR.dom.walker.whitespaces( true ); 174 179 175 180 /** … … 206 211 first && isNbsp( first ) && first.remove(); 207 212 } 208 213 209 // If the fixed block is blank and already followed by a exitable210 // block, we should revert the fix . (#3684)211 if ( fixedBlock.getOuterHtml().match( emptyParagraphRegexp) )214 // If the fixed block is actually blank and is already followed by an exitable blank 215 // block, we should revert the fix and move into the existed one. (#3684) 216 if ( isBlankParagraph( fixedBlock ) ) 212 217 { 213 218 var previousElement = fixedBlock.getPrevious( isNotWhitespace ), 214 219 nextElement = fixedBlock.getNext( isNotWhitespace ); 215 220 216 221 if ( previousElement && previousElement.getName 217 222 && !( previousElement.getName() in nonExitableElementNames ) 223 && isBlankParagraph( previousElement ) 218 224 && range.moveToElementEditStart( previousElement ) 219 225 || nextElement && nextElement.getName 220 && !( nextElement.getName() in nonExitableElementNames ) 221 && range.moveToElementEditStart( nextElement ) ) 226 && !( nextElement.getName() in nonExitableElementNames ) 227 && isBlankParagraph( nextElement ) 228 && range.moveToElementEditStart( nextElement ) ) 222 229 { 223 230 fixedBlock.remove(); 224 231 }