JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.4
[ckeditor.git] / _source / core / htmlparser / element.js
index 4c17265..2795eb7 100644 (file)
@@ -25,7 +25,7 @@ CKEDITOR.htmlParser.element = function( name, attributes )
         * @type Object\r
         * @example\r
         */\r
-       this.attributes = attributes || ( attributes = {} );\r
+       this.attributes = attributes || {};\r
 \r
        /**\r
         * The nodes that are direct children of this element.\r
@@ -34,29 +34,27 @@ CKEDITOR.htmlParser.element = function( name, attributes )
         */\r
        this.children = [];\r
 \r
-       var tagName = attributes[ 'data-cke-real-element-type' ] || name || '';\r
+       // Reveal the real semantic of our internal custom tag name (#6639),\r
+       // when resolving whether it's block like.\r
+       var realName = name || '',\r
+               prefixed = realName.match( /^cke:(.*)/ );\r
+       prefixed && ( realName = prefixed[ 1 ] );\r
 \r
-       // Reveal the real semantic of our internal custom tag name (#6639).\r
-       var internalTag = tagName.match( /^cke:(.*)/ );\r
-       internalTag && ( tagName = internalTag[ 1 ] );\r
+       var isBlockLike = !!( CKEDITOR.dtd.$nonBodyContent[ realName ]\r
+                               || CKEDITOR.dtd.$block[ realName ]\r
+                               || CKEDITOR.dtd.$listItem[ realName ]\r
+                               || CKEDITOR.dtd.$tableContent[ realName ]\r
+                               || CKEDITOR.dtd.$nonEditable[ realName ]\r
+                               || realName == 'br' );\r
 \r
-       var dtd                 = CKEDITOR.dtd,\r
-               isBlockLike     = !!( dtd.$nonBodyContent[ tagName ]\r
-                               || dtd.$block[ tagName ]\r
-                               || dtd.$listItem[ tagName ]\r
-                               || dtd.$tableContent[ tagName ]\r
-                               || dtd.$nonEditable[ tagName ]\r
-                               || tagName == 'br' ),\r
-               isEmpty = !!dtd.$empty[ name ];\r
-\r
-       this.isEmpty    = isEmpty;\r
-       this.isUnknown  = !dtd[ name ];\r
+       this.isEmpty    = !!CKEDITOR.dtd.$empty[ name ];\r
+       this.isUnknown  = !CKEDITOR.dtd[ name ];\r
 \r
        /** @private */\r
        this._ =\r
        {\r
                isBlockLike : isBlockLike,\r
-               hasInlineStarted : isEmpty || !isBlockLike\r
+               hasInlineStarted : this.isEmpty || !isBlockLike\r
        };\r
 };\r
 \r