Nested lists do not produce valid HTML

89 views
Skip to first unread message

Keith S.

unread,
Jan 26, 2011, 5:47:35 PM1/26/11
to bluegriffon
Hi there,

I just downloaded BlueGriffon today (0.8.1 nightly), as I'm looking
for a good, simple WYSIWIG editor to recommend to the people in my
office who INSIST on using MS Word, despite my pleas not to.

One thing I noticed -- which is an issue for me, because I have tools
that depend on this -- is that you are not generating your nested
lists correctly. The nested list is appearing AFTER the list item,
instead of INSIDE the previous list item.

Specifically, here is what BlueGriffon produces:

<ol>
<li>This is the first bullet</li>
<ul>
<li>This is the first bullet under there</li>
<li>And the second one under that.</li>
<ul>
<li>A sub-sub bullet</li>
<li>And more</li>
</ul>
</ul>
<li>This is the second bullet.</li>
</ol>

Here is what it SHOULD produce according to the specs and most
validators:

<ol>
<li>This is the first bullet
<ul>
<li>This is the first bullet under there</li>
<li>And the second one under that.
<ul>
<li>A sub-sub bullet</li>
<li>And more</li>
</ul></li>
</ul></li>
<li>This is the second bullet.</li>
</ol>

Note that the nested <ul> must appear BEFORE the closing list tag (</
li>) of the line before it. In other words a <ul> as a child of <ol>
or <ul> is invalid; it must be a child of another <li> tag.

See http://www.w3schools.com/xhtml/xhtml_html.asp for further
explanation.

Now, just to be clear: what you produced WILL render. And from the
doctype, it's clear that the goal is produce HTML5 code, not XHTML
code. HOWEVER, this still doesn't pass validation, even for HTML 5. If
you remove all of the closing </li> tags, then it does. And that's a
perfectly fine option, too, if you want to exclude XHTML support.

Thanks,
Keith

Daniel Glazman

unread,
Jan 27, 2011, 1:05:46 AM1/27/11
to blueg...@googlegroups.com
Le 26/01/11 23:47, Keith S. a �crit :

> Hi there,
>
> I just downloaded BlueGriffon today (0.8.1 nightly), as I'm looking
> for a good, simple WYSIWIG editor to recommend to the people in my
> office who INSIST on using MS Word, despite my pleas not to.
>
> One thing I noticed -- which is an issue for me, because I have tools
> that depend on this -- is that you are not generating your nested
> lists correctly. The nested list is appearing AFTER the list item,
> instead of INSIDE the previous list item.

Yes. That's an old bug (really old) in the Netscape/Mozilla editor.
I am working on it. In the meantime there's an option fixing the
lists in Tools > Markup Cleaner.

</Daniel>

Keith S.

unread,
Feb 2, 2011, 3:25:05 PM2/2/11
to bluegriffon
Ah, I didn't realize that was your base. Okay, that makes sense then.
(Everybody has this bug -- even otherwise-pristine-markup-generator
Open Office.)

Thanks for the tip on the option - very useful!

Keith
Reply all
Reply to author
Forward
0 new messages