| 406 | // Fix orphaned <li> nodes (Bug #503). |
| 407 | li : function( node, htmlNode, targetNode ) |
| 408 | { |
| 409 | // If the XML parent node is already a <ul> or <ol>, then add the <li> as usual. |
| 410 | if ( targetNode.nodeName.IEquals( ['ul', 'ol'] ) ) |
| 411 | return FCKXHtml._AppendChildNodes( node, htmlNode, true ) ; |
| 412 | |
| 413 | var newTarget ; |
| 414 | |
| 415 | // Try to group orphaned <li> nodes into the last <ul>. |
| 416 | // Create one if the previous added node wasn't an <ul>. |
| 417 | if ( targetNode.lastChild && targetNode.lastChild.nodeName.IEquals( 'ul' ) ) |
| 418 | newTarget = targetNode.lastChild ; |
| 419 | else |
| 420 | newTarget = FCKXHtml.XML.createElement( 'ul' ) ; |
| 421 | htmlNode._fckxhtmljob = null ; |
| 422 | FCKXHtml._AppendNode( newTarget, htmlNode ) ; |
| 423 | return newTarget ; |
| 424 | }, |
| 425 | |