X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Felement.js;h=2795eb7ce3598e4942b6009893806ac3dcb3d88c;hp=4c17265504841f1b1f7d660126d149af34992fe6;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hpb=2f22c0c38f17e75be5541089076885442aaa2377 diff --git a/_source/core/htmlparser/element.js b/_source/core/htmlparser/element.js index 4c17265..2795eb7 100644 --- a/_source/core/htmlparser/element.js +++ b/_source/core/htmlparser/element.js @@ -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 }; };