Ticket #6972: dd_dt_li.patch
File dd_dt_li.patch, 2.3 KB (added by , 13 years ago) |
---|
-
fragment.js
130 130 else 131 131 elementName = element.name; 132 132 133 if ( elementName && elementName in CKEDITOR.dtd.$inline ) 133 //revert to original 134 //better ? fix malform html 135 if (elementName 136 && !( elementName in CKEDITOR.dtd.$body ) 137 && !( elementName in CKEDITOR.dtd.$nonBodyContent )) 134 138 { 135 139 var savedCurrent = currentNode; 136 140 137 // Create a <p> in the fragment. 138 currentNode = target; 139 parser.onTagOpen( fixForBody, {} ); 141 // Create a <p/dl/ul> in the fragment. 142 currentNode = target; 143 var meta = { 144 li:"ul", 145 dt:"dl", 146 dd:"dl" 147 }; 148 parser.onTagOpen(meta[elementName] || fixForBody, {}); 140 149 141 // The new target now is the <p >.150 // The new target now is the <p/dl/ul>. 142 151 target = currentNode; 143 152 144 153 if ( enforceCurrent ) … … 236 245 { 237 246 addElement( currentNode, currentNode.parent ); 238 247 } 239 else if ( tagName in CKEDITOR.dtd.$listItem ) 240 { 241 parser.onTagOpen( 'ul', {} ); 242 addPoint = currentNode; 243 reApply = true; 244 } 248 //do not need this ?? 249 // else if ( tagName in CKEDITOR.dtd.$listItem ) 250 // { 251 // parser.onTagOpen( 'ul', {} ); 252 // addPoint = currentNode; 253 // reApply = true; 254 // } 245 255 else 246 256 { 247 if ( nonBreakingBlocks[ currentName ] ) 257 //sorry about this ugly exclusion,i am not actually sure 258 if (!currentName in {li:1,dd:1,dt:1} && nonBreakingBlocks[ currentName ]) 248 259 { 249 260 if ( !returnPoint ) 250 261 returnPoint = currentNode; … … 253 264 { 254 265 addElement( currentNode, currentNode.parent, true ); 255 266 256 if ( !optionalClose[ currentName ] ) 267 //only care about inline 268 if (!optionalClose[ currentName ] && currentName in CKEDITOR.dtd.$inline) 257 269 { 258 270 // The current element is an inline element, which 259 271 // cannot hold the new one. Put it in the pending list,