Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 1383)
+++ _whatsnew.html (working copy)
@@ -47,11 +47,12 @@
several "strict warning" messages in Firefox when running FCKeditor.
[#1522] The ENTER
key will now work properly in IE with the cursor at the start of a formatted block.
- [#1503] It's possible
- to define in the Styles that a Style (with an empty class) must be shown selected
- only when no class is present in the current element, and selecting that item will
- clear the current class (it does apply to any attribute, not only classes).
-
+ [#1503] It's
+ possible to define in the Styles that a Style (with an empty class) must be shown
+ selected only when no class is present in the current element, and selecting that
+ item will clear the current class (it does apply to any attribute, not only classes).
+ [#503] Orphaned
+ <li> elements now get properly enclosed in a <ul> on output.
See previous versions history
Index: editor/_source/internals/fck.js
===================================================================
--- editor/_source/internals/fck.js (revision 1383)
+++ editor/_source/internals/fck.js (working copy)
@@ -176,7 +176,9 @@
{
// Element Node.
case 1 :
- if ( !FCKListsLib.BlockElements[ oNode.nodeName.toLowerCase() ] &&
+ var nodeName = oNode.nodeName.toLowerCase() ;
+ if ( !FCKListsLib.BlockElements[ nodeName ] &&
+ nodeName != 'li' &&
!oNode.getAttribute('_fckfakelement') &&
oNode.getAttribute('_moz_dirty') == null )
bMoveNode = true ;
Index: editor/_source/internals/fckxhtml.js
===================================================================
--- editor/_source/internals/fckxhtml.js (revision 1383)
+++ editor/_source/internals/fckxhtml.js (working copy)
@@ -403,6 +403,35 @@
return node ;
},
+ // Fix orphaned
nodes (Bug #503).
+ li : function( node, htmlNode, targetNode )
+ {
+ // If the XML parent node is already a or , then add the - as usual.
+ if ( targetNode.nodeName.IEquals( ['ul', 'ol'] ) )
+ return FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
+
+ var newTarget = FCKXHtml.XML.createElement( 'ul' ) ;
+
+ // Reset the _fckxhtmljob so the HTML node is processed again.
+ htmlNode._fckxhtmljob = null ;
+
+ // Loop through all sibling LIs, adding them to the
.
+ do
+ {
+ FCKXHtml._AppendNode( newTarget, htmlNode ) ;
+
+ // Look for the next element following this - .
+ do
+ {
+ htmlNode = FCKDomTools.GetNextSibling( htmlNode ) ;
+ }
+ while ( htmlNode && htmlNode.nodeType == 3 && htmlNode.nodeValue.Trim().length == 0 )
+ }
+ while ( htmlNode && htmlNode.nodeName.toLowerCase() == 'li' )
+
+ return newTarget ;
+ },
+
// Fix nested
and .
ol : function( node, htmlNode, targetNode )
{