Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 4665)
+++ /CKEditor/trunk/CHANGES.html (revision 4666)
@@ -157,4 +157,5 @@
#4518 : Fixed unable to open dialog without editor focus in IE.
#4519 : Fixed maximize without editor focus throw error in IE.
+ #4543 : Fixed unable to move cursor between table and hr.
Updated the following language files:
- #3947 : Arabic;
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js (revision 4665)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js (revision 4666)
@@ -16,5 +16,5 @@
var nonExitableElementNames = { table:1,pre:1 };
// Matching an empty paragraph at the end of document.
- var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:
]*>| |\u00A0| )\s*(:?<\/\1>)?\s*$/gi;
+ var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:
]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*$/gi;
function onInsertHtml( evt )
@@ -179,6 +179,5 @@
{
restoreDirty( editor );
- var bms = selection.createBookmarks(),
- fixedBlock = range.fixBlock( true,
+ var fixedBlock = range.fixBlock( true,
editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
@@ -190,30 +189,27 @@
}
- selection.selectBookmarks( bms );
-
- // If the fixed block is blank and is already followed by a exitable
- // block, we should drop it and move to the exist block(#3684).
- var children = fixedBlock.getChildren(),
- count = children.count(),
- firstChild,
- previousElement = fixedBlock.getPrevious( isNotWhitespace ),
- nextElement = fixedBlock.getNext( isNotWhitespace ),
- enterBlock;
- if ( previousElement && previousElement.getName
- && !( previousElement.getName() in nonExitableElementNames ) )
- enterBlock = previousElement;
- else if ( nextElement && nextElement.getName
- && !( nextElement.getName() in nonExitableElementNames ) )
- enterBlock = nextElement;
-
- // Not all blocks are editable, e.g.
, further checking it.(#3994)
- if( ( !count
- || ( firstChild = children.getItem( 0 ) ) && firstChild.is && firstChild.is( 'br' ) )
- && enterBlock
- && range.moveToElementEditStart( enterBlock ) )
+ // If the fixed block is blank and already followed by a exitable
+ // block, we should revert the fix. (#3684)
+ if( fixedBlock.getOuterHtml().match( emptyParagraphRegexp ) )
{
- fixedBlock.remove();
- range.select();
+ var previousElement = fixedBlock.getPrevious( isNotWhitespace ),
+ nextElement = fixedBlock.getNext( isNotWhitespace );
+
+
+ if ( previousElement && previousElement.getName
+ && !( previousElement.getName() in nonExitableElementNames )
+ && range.moveToElementEditStart( previousElement )
+ || nextElement && nextElement.getName
+ && !( nextElement.getName() in nonExitableElementNames )
+ && range.moveToElementEditStart( nextElement ) )
+ {
+ fixedBlock.remove();
+ }
}
+
+ range.select();
+ // Notify non-IE that selection has changed.
+ if( !CKEDITOR.env.ie )
+ editor.selectionChange();
}