X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Felement.js;h=9643e0d7ca56ab705c81bf9d31072e6254e8585b;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=4c17265504841f1b1f7d660126d149af34992fe6;hpb=2f22c0c38f17e75be5541089076885442aaa2377;p=ckeditor.git diff --git a/_source/core/htmlparser/element.js b/_source/core/htmlparser/element.js index 4c17265..9643e0d 100644 --- a/_source/core/htmlparser/element.js +++ b/_source/core/htmlparser/element.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -25,7 +25,7 @@ CKEDITOR.htmlParser.element = function( name, attributes ) * @type Object * @example */ - this.attributes = attributes || ( attributes = {} ); + this.attributes = attributes || {}; /** * The nodes that are direct children of this element. @@ -34,29 +34,27 @@ CKEDITOR.htmlParser.element = function( name, attributes ) */ this.children = []; - var tagName = attributes[ 'data-cke-real-element-type' ] || name || ''; + // Reveal the real semantic of our internal custom tag name (#6639), + // when resolving whether it's block like. + var realName = name || '', + prefixed = realName.match( /^cke:(.*)/ ); + prefixed && ( realName = prefixed[ 1 ] ); - // Reveal the real semantic of our internal custom tag name (#6639). - var internalTag = tagName.match( /^cke:(.*)/ ); - internalTag && ( tagName = internalTag[ 1 ] ); + var isBlockLike = !!( CKEDITOR.dtd.$nonBodyContent[ realName ] + || CKEDITOR.dtd.$block[ realName ] + || CKEDITOR.dtd.$listItem[ realName ] + || CKEDITOR.dtd.$tableContent[ realName ] + || CKEDITOR.dtd.$nonEditable[ realName ] + || realName == 'br' ); - var dtd = CKEDITOR.dtd, - isBlockLike = !!( dtd.$nonBodyContent[ tagName ] - || dtd.$block[ tagName ] - || dtd.$listItem[ tagName ] - || dtd.$tableContent[ tagName ] - || dtd.$nonEditable[ tagName ] - || tagName == 'br' ), - isEmpty = !!dtd.$empty[ name ]; - - this.isEmpty = isEmpty; - this.isUnknown = !dtd[ name ]; + this.isEmpty = !!CKEDITOR.dtd.$empty[ name ]; + this.isUnknown = !CKEDITOR.dtd[ name ]; /** @private */ this._ = { isBlockLike : isBlockLike, - hasInlineStarted : isEmpty || !isBlockLike + hasInlineStarted : this.isEmpty || !isBlockLike }; };