X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fwysiwygarea%2Fplugin.js;h=df2fd07968a1d1aa33943449699d529fe3cf0f6c;hp=5ea1f1aaed438cc26459d302b5ee96bc92e6bada;hb=614511639979907ceb0da3614122a4d8eb963ad4;hpb=039a051ccf3901311661022a30afd60fc38130c9 diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index 5ea1f1a..df2fd07 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -18,6 +18,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ); + // Elements that could have empty new line around, including table, pre-formatted block, hr, page-break. (#6554) + function nonExitable( element ) + { + return ( element.getName() in nonExitableElementNames ) + || element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ]; + } + function checkReadOnly( selection ) { if ( selection.getType() == CKEDITOR.SELECTION_ELEMENT ) @@ -317,7 +324,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var element = fixedBlock.getNext( isNotWhitespace ); if ( element && element.type == CKEDITOR.NODE_ELEMENT && - !nonExitableElementNames[ element.getName() ] ) + !nonExitable( element ) ) { range.moveToElementEditStart( element ); fixedBlock.remove(); @@ -327,7 +334,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license element = fixedBlock.getPrevious( isNotWhitespace ); if ( element && element.type == CKEDITOR.NODE_ELEMENT && - !nonExitableElementNames[ element.getName() ] ) + !nonExitable( element ) ) { range.moveToElementEditEnd( element ); fixedBlock.remove(); @@ -1026,7 +1033,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml( // Use 'span' instead of anything else to fly under the screen-reader radar. (#5049) - '' ) ); + '' ) ); focusGrabber.on( 'focus', function() {