Re: Allow UL/OL as direct children of UL/OL?

Rocky Kahn wrote:
> The HTML 5 draft and preceding w3c
> standards<http://www.w3.org/html/wg/html5/#the-ol>seem to specify that
> <ul>/<ol> can not be direct child of <ul>/<ol>.
> Specifically, the content model of <ol> and <ul> is "Zero or more
> li<http://www.w3.org/html/wg/html5/#li>elements."  This poses a
> problem for designing a rich text editor (which
> we're doing).  Typically, when users add a list item onto an already created
> list, it is encoded as a separate list rather than joining it with previous
> list items.  Consider a case where a user of a rich text editor such as
> Google Mail or Google Documents starts with "apple" & "banana" at level 1
> and "pear" at level 2 as shown below:
>   * apple
>     * pear
>   * banana
> When the user indents "banana", it's coded as a separate <UL> as shown
> below.
>> <ul>
>>   <li>apple</li>
>>   <ul>
>>     <li>pear</li>
>>    </ul>
>>   <ul>
>>     <li>banana</li>
>>   </ul>
>> </ul>

This is a problem with the editor, not with HTML.  To do nested lists, 
the sub-lists need to be put within an <li> element of the parent list.

<ul>
   <li>apple
     <ul>
       <li>pear</li>
     </ul>
   </li>
   <li>banana</li>
</ul>

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Sunday, 25 May 2008 19:27:41 UTC