j4: (dodecahedron)
[personal profile] j4
Okay, I think I'm going mad. I put the following into our CMS:
<ul>
<li> Item 1
<ul>
<li> SubItem 1</li>
<li> SubItem 2</li>
</ul>
</li>
<li> Item 2</li>
</ul>
and it (silently, without any notification) 'corrected' it to the following:
<ul>
<li>Item 1
<ul></ul></li>
<li>SubItem 1</li>
<li>SubItem 2</li>
<li>Item 2</li></ul>
I pointed this out to the people who are setting up the new site for us, and they raised it as a support call with the CMS people, and got the following response:
"Could you please use the following schema:

<ul>
<li>Item 1</li>
<ul>
<li>SubItem 1</li>
<li>SubItem 2</li>
</ul>
<li>Item 2</li>
</ul>


Such syntax is formatted correctly."
If such syntax is formatted correctly, why doesn't it validate? I'm not even trying to be a validation Nazi about this (it's not as if anything that comes out of this CMS is ever going to validate anyway), it's more that I don't really want to have to 'correct' all our existing HTML to prevent it being 'corrected' by the CMS.

Date: 2007-03-20 10:37 am (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
I'm not sure about number 2. Because you don't know where the implicity /li is going in you can't say that the sublist isn't in it really.

Certainly my reading of the usage at http://www.w3.org/TR/html401/struct/lists.html#edef-UL implies to me that ULs and OLs may only contain LIs and that LIs may contian any flow type stuff (which would include ULs and OLs). I don't think there is a valid deprecated usage where a UL or OL could be in another one of them without being inside an LI as well.

Date: 2007-03-20 10:49 am (UTC)
From: [identity profile] bellinghman.livejournal.com
Ah, bugger.

The deprecated example has omitted </li>, so the sublist is effectively within a <li>. Which just goes to show that omitting close attribute tags is stupid and should always have been banned.

Date: 2007-03-20 10:52 am (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
I agree. The only time it should have been acceptable was for self closing tags like br and hr where a closing tag doesn't make sense. And even then it would have been nicer if they'd enforced making them self closing since if they'd introduced it at the beginning nobody would have had a problem with it. Damn them all. :)

Date: 2007-03-20 10:56 am (UTC)
From: [identity profile] bellinghman.livejournal.com
Aye.

Hence the distinction between 'attribute' tags (forgive me if I don't use correct terminology here) and br. And hr, which I didn't remember.

<br/> style self-closing would have been good, too, but I can understand them not getting that first time round.

June 2025

S M T W T F S
1234567
891011121314
15 161718192021
22232425262728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 26th, 2025 10:45 am
Powered by Dreamwidth Studios