421 | | // First, try to group by a list ancestor. |
422 | | for ( var i = 0 ; i < path.elements.length ; i++ ) |
423 | | { |
424 | | var element = path.elements[i]; |
425 | | if ( listNodeNames[ element.getName() ] ) |
426 | | { |
427 | | // If we've encountered a list inside a block limit |
428 | | // The last group object of the block limit element should |
429 | | // no longer be valid. Since paragraphs after the list |
430 | | // should belong to a different group of paragraphs before |
431 | | // the list. (Bug #1309) |
432 | | blockLimit.removeCustomData( 'list_group_object' ); |
| 421 | // Split list structure by table element, although allow nested lists to be handled by code below. |
| 422 | if ( blockLimit.getName() == 'body' || block.getName() == 'li' ) |
| 423 | { |
| 424 | // First, try to group by a list ancestor. |
| 425 | for ( var i = 0 ; i < path.elements.length ; i++ ) |
| 426 | { |
| 427 | var element = path.elements[i]; |
| 428 | |
| 429 | if ( listNodeNames[ element.getName() ] ) |
| 430 | { |
| 431 | // If we've encountered a list inside a block limit |
| 432 | // The last group object of the block limit element should |
| 433 | // no longer be valid. Since paragraphs after the list |
| 434 | // should belong to a different group of paragraphs before |
| 435 | // the list. (Bug #1309) |
| 436 | blockLimit.removeCustomData( 'list_group_object' ); |
434 | | var groupObj = element.getCustomData( 'list_group_object' ); |
435 | | if ( groupObj ) |
436 | | groupObj.contents.push( block ); |
437 | | else |
438 | | { |
439 | | groupObj = { root : element, contents : [ block ] }; |
440 | | listGroups.push( groupObj ); |
441 | | CKEDITOR.dom.element.setMarker( database, element, 'list_group_object', groupObj ); |
442 | | } |
443 | | processedFlag = true; |
444 | | break; |
445 | | } |
446 | | } |
| 438 | var groupObj = element.getCustomData( 'list_group_object' ); |
| 439 | if ( groupObj ) |
| 440 | groupObj.contents.push( block ); |
| 441 | else |
| 442 | { |
| 443 | groupObj = { root : element, contents : [ block ] }; |
| 444 | listGroups.push( groupObj ); |
| 445 | CKEDITOR.dom.element.setMarker( database, element, 'list_group_object', groupObj ); |
| 446 | } |
| 447 | processedFlag = true; |
| 448 | break; |
| 449 | } |
| 450 | } |
| 451 | } |