Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5874)
+++ /CKEditor/trunk/CHANGES.html (revision 5875)
@@ -77,4 +77,5 @@
#4472 : [FF3] Browserwindow scrolls to loaded ckEditor.
#6230 : Fixed invalid parameter count for setTimeout function call.
+ #5335 : Several lines' formatted data will be merged to one line when we apply Numbers/Bullets.
Updated the following language files:
- #6246 : Chinese Simplified;
Index: /CKEditor/trunk/_source/plugins/domiterator/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/domiterator/plugin.js (revision 5874)
+++ /CKEditor/trunk/_source/plugins/domiterator/plugin.js (revision 5875)
@@ -1,3 +1,3 @@
-/*
+/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -45,4 +45,7 @@
var isLast;
+ // Indicate at least one of the range boundaries is inside a preformat block.
+ var touchPre;
+
// Instructs to cleanup remaining BRs.
var removePreviousBr, removeLastBr;
@@ -56,5 +59,8 @@
range.shrink( CKEDITOR.NODE_ELEMENT, true );
- range.enlarge( this.forceBrBreak || !this.enlargeBr ?
+ touchPre = range.endContainer.hasAscendant( 'pre', true )
+ || range.startContainer.hasAscendant( 'pre', true );
+
+ range.enlarge( this.forceBrBreak && !touchPre || !this.enlargeBr ?
CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS );
@@ -107,5 +113,6 @@
// closeRange indicates that a paragraph boundary has been found,
// so the range can be closed.
- var closeRange = false;
+ var closeRange = false,
+ parentPre = currentNode.hasAscendant( 'pre' );
// includeNode indicates that the current node is good to be part
@@ -120,5 +127,6 @@
var nodeName = currentNode.getName();
- if ( currentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) )
+ if ( currentNode.isBlockBoundary( this.forceBrBreak &&
+ !parentPre && { br : 1 } ) )
{
//
boundaries must be part of the range. It will
@@ -194,5 +202,6 @@
var parentNode = currentNode.getParent();
- if ( parentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) )
+ if ( parentNode.isBlockBoundary( this.forceBrBreak
+ && !parentPre && { br : 1 } ) )
{
closeRange = true;
Index: /CKEditor/trunk/_source/plugins/list/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/list/plugin.js (revision 5874)
+++ /CKEditor/trunk/_source/plugins/list/plugin.js (revision 5875)
@@ -300,6 +300,6 @@
listItem = doc.createElement( 'li' );
- // Preserve heading structure when converting to list item. (#5271)
- if ( headerTagRegex.test( contentBlock.getName() ) )
+ // Preserve preformat block and heading structure when converting to list item. (#5335) (#5271)
+ if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) )
contentBlock.appendTo( listItem );
else
@@ -313,11 +313,11 @@
contentBlock.moveChildren( listItem );
contentBlock.remove();
+
+ // Append a bogus BR to force the LI to render at full height
+ if ( !CKEDITOR.env.ie )
+ listItem.appendBogus();
}
listItem.appendTo( listNode );
-
- // Append a bogus BR to force the LI to render at full height
- if ( !CKEDITOR.env.ie )
- listItem.appendBogus();
}