Skip to content

Commit

Permalink
Merge branch 't/11798'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed May 7, 2014
2 parents 3125bcd + a687497 commit 8c6d5e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -20,6 +20,7 @@ Fixed Issues:
* [#11823](http://dev.ckeditor.com/ticket/11823): Fixed: [IE8] [Table Resize](http://ckeditor.com/addon/tableresize) throws error over scrollbar.
* [#11788](http://dev.ckeditor.com/ticket/11788): Fixed: It is not possible to change language back to undefined in [Code Snippet](http://ckeditor.com/addon/codesnippet) dialog.
* [#11788](http://dev.ckeditor.com/ticket/11788): Fixed: [Filter](http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.filter) rules are not applied inside elements with `contenteditable` attribute set to `true`.
* [#11798](http://dev.ckeditor.com/ticket/11798): Fixed: Inserting non-editable element inside a table cell breaks the table badly.

Other changes:

Expand Down
31 changes: 27 additions & 4 deletions core/dom/range.js
Expand Up @@ -1412,18 +1412,19 @@ CKEDITOR.dom.range = function( root ) {
return;
}


// Enlarging the end boundary.
// Set up new range and reset all flags (blockBoundary, inNonEditable, tailBr).

walkerRange = this.clone();
walkerRange.collapse();
walkerRange.setEndAt( boundary, CKEDITOR.POSITION_BEFORE_END );
walker = new CKEDITOR.dom.walker( walkerRange );

// tailBrGuard only used for on range end.
walker.guard = ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? tailBrGuard : boundaryGuard;
blockBoundary = null;
// End the range right before the block boundary node.
blockBoundary = inNonEditable = tailBr = null;

// End the range right before the block boundary node.
enlargeable = walker.lastForward();

// It's the body which stop the enlarging if no block boundary found.
Expand Down Expand Up @@ -1807,7 +1808,29 @@ CKEDITOR.dom.range = function( root ) {
},

/**
* @todo
* Wraps inline content found around the range's start or end boundary
* with a block element.
*
* // Assuming following range:
* // <h1>foo</h1>ba^r<br />bom<p>foo</p>
* // The result of executing:
* range.fixBlock( true, 'p' );
* // Will be:
* // <h1>foo</h1><p>ba^r<br />bom</p><p>foo</p>
*
* Non collapsed range:
*
* // Assuming following range:
* // ba[r<p>foo</p>bo]m
* // The result of executing:
* range.fixBlock( false, 'p' );
* // Will be:
* // ba[r<p>foo</p><p>bo]m</p>
*
* @param {Boolean} [isStart=false] Whether range's start or end boundary should be checked.
* @param {String} blockTag Name of a block element in which content will be wrapped.
* For example `'p'`.
* @returns {CKEDITOR.dom.element} Created block wrapper.
*/
fixBlock: function( isStart, blockTag ) {
var bookmark = this.createBookmark(),
Expand Down

0 comments on commit 8c6d5e4

Please sign in to comment.