public/ckeditor/4.4dev/core/editable.js
function( element, range ) {
				var editor = this.editor,
					enterMode = editor.config.enterMode,
					elementName = element.getName(),
					isBlock = CKEDITOR.dtd.$block[ elementName ];

				if ( range.checkReadOnly() )
					return false;

				// Remove the original contents, merge split nodes.
				range.deleteContents( 1 );

				// If range is placed in inermediate element (not td or th), we need to do three things:
				// * fill emptied <td/th>s with if browser needs them,
				// * remove empty text nodes so IE8 won't crash (http://dev.ckeditor.com/ticket/11183#comment:8),
				// * fix structure and move range into the <td/th> element.
				if ( range.startContainer.type == CKEDITOR.NODE_ELEMENT && range.startContainer.is( { tr: 1, table: 1, tbody: 1, thead: 1, tfoot: 1 } ) )
					fixTableAfterContentsDeletion( range );

				// If we're inserting a block at dtd-violated position, split
				// the parent blocks until we reach blockLimit.
				var current, dtd;

				if ( isBlock ) {
					while ( ( current = range.getCommonAncestor( 0, 1 ) ) &&
							( dtd = CKEDITOR.dtd[ current.getName() ] ) &&
							!( dtd && dtd[ elementName ] ) ) {
						// Split up inline elements.
						if ( current.getName() in CKEDITOR.dtd.span )
							range.splitElement( current );

						// If we're in an empty block which indicate a new paragraph,
						// simply replace it with the inserting block.(#3664)
						else if ( range.checkStartOfBlock() && range.checkEndOfBlock() ) {
							range.setStartBefore( current );
							range.collapse( true );
							current.remove();
						} else {
							range.splitBlock( enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p', editor.editable() );
						}
					}
				}

				// Insert the new node.
				range.insertNode( element );

				// Return true if insertion was successful.
				return true;
			}
function( element, range ) {
				var editor = this.editor,
					enterMode = editor.config.enterMode,
					elementName = element.getName(),
					isBlock = CKEDITOR.dtd.$block[ elementName ];

				if ( range.checkReadOnly() )
					return false;

				// Remove the original contents, merge split nodes.
				range.deleteContents( 1 );

				// If range is placed in inermediate element (not td or th), we need to do three things:
				// * fill emptied <td/th>s with if browser needs them,
				// * remove empty text nodes so IE8 won't crash (http://dev.ckeditor.com/ticket/11183#comment:8),
				// * fix structure and move range into the <td/th> element.
				if ( range.startContainer.type == CKEDITOR.NODE_ELEMENT && range.startContainer.is( { tr: 1, table: 1, tbody: 1, thead: 1, tfoot: 1 } ) )
					fixTableAfterContentsDeletion( range );

				// If we're inserting a block at dtd-violated position, split
				// the parent blocks until we reach blockLimit.
				var current, dtd;

				if ( isBlock ) {
					while ( ( current = range.getCommonAncestor( 0, 1 ) ) &&
							( dtd = CKEDITOR.dtd[ current.getName() ] ) &&
							!( dtd && dtd[ elementName ] ) ) {
						// Split up inline elements.
						if ( current.getName() in CKEDITOR.dtd.span )
							range.splitElement( current );

						// If we're in an empty block which indicate a new paragraph,
						// simply replace it with the inserting block.(#3664)
						else if ( range.checkStartOfBlock() && range.checkEndOfBlock() ) {
							range.setStartBefore( current );
							range.collapse( true );
							current.remove();
						} else {
							range.splitBlock( enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p', editor.editable() );
						}
					}
				}

				// Insert the new node.
				range.insertNode( element );

				// Return true if insertion was successful.
				return true;
			}
function ( element , range ) { var editor = this . editor , enterMode = editor . config . enterMode , elementName = element . getName ( ) , isBlock = CKEDITOR . dtd . $block [ elementName ] ; if ( range . checkReadOnly ( ) ) return false ; // Remove the original contents, merge split nodes. range . deleteContents ( 1 ) ; // If range is placed in inermediate element (not td or th), we need to do three things: // * fill emptied <td/th>s with if browser needs them, // * remove empty text nodes so IE8 won't crash (http://dev.ckeditor.com/ticket/11183#comment:8), // * fix structure and move range into the <td/th> element. if ( range . startContainer . type == CKEDITOR . NODE_ELEMENT && range . startContainer . is ( { tr : 1 , table : 1 , tbody : 1 , thead : 1 , tfoot : 1 } ) ) fixTableAfterContentsDeletion ( range ) ; // If we're inserting a block at dtd-violated position, split // the parent blocks until we reach blockLimit. var current , dtd ; if ( isBlock ) { while ( ( current = range . getCommonAncestor ( 0 , 1 ) ) && ( dtd = CKEDITOR . dtd [ current . getName ( ) ] ) && ! ( dtd && dtd [ elementName ] ) ) { // Split up inline elements. if ( current . getName ( ) in CKEDITOR . dtd . span ) range . splitElement ( current ) ; // If we're in an empty block which indicate a new paragraph, // simply replace it with the inserting block.(#3664) else if ( range . checkStartOfBlock ( ) && range . checkEndOfBlock ( ) ) { range . setStartBefore ( current ) ; range . collapse ( true ) ; current . remove ( ) ; } else { range . splitBlock ( enterMode == CKEDITOR . ENTER_DIV ? 'div' : 'p' , editor . editable ( ) ) ; } } } // Insert the new node. range . insertNode ( element ) ; // Return true if insertion was successful. return true ; }
Inserts an element into the position in the editor determined by range.

@param {CKEDITOR.dom.element} element The element to be inserted.
@param {CKEDITOR.dom.range} range The range as a place of insertion.
@returns {Boolean} Informs whether insertion was successful.
Inserts an element into the position in the editor determined by range .