Sergiu Dumitriu wrote:
Thomas Mortagne wrote:
On Sat, Jan 3, 2009 at 4:49 PM, Marius Dumitru
Florea <
mariusdumitru.florea(a)xwiki.com> wrote:
Regarding the toc macro, I don't see the
relation between header level
and list level. I guess the toc macro generates:
** h2
**** h4
for
== h2 ==
==== h4 ====
while I personally expect
* h2
** h4
What I expect is that the list level/style is always consitent with the
heading level/style: if you have two wiki pages, one with level one headers
and the other without level one headers you should not get the same toc IMO.
How is such a list displayed? I remember trying to do something with
nested lists a while back, and the browsers were rendering it
differently. Although at the markup level for this scenario
** h2
**** h4
seems better, how will it be rendered?
Here comes the "funny" part: It depends on the generated HTML. Although
there's just one way to write valid HTML for nested lists, browsers (FF
& IE) can render nested lists in two ways:
A) Valid HTML:
<ul>
<li>
<ul>
<li>x</li>
</ul>
</li>
</ul>
will generate
o
o x
B) Invalid HTML:
<ul>
<ul>
<li>x</li>
</ul>
</ul>
will generate
o x
as if the list item was indented MS Word-like.
I really don't want to handle two kinds of markup for nested lits on the
WYSIWYG editor. I'm definitely for valid HTML, thus for A). Otherwise
the editor might generate mixed markup like:
<ul>
<!-- invalid here -->
<ul>
<li>x</li>
<li>
<!-- valid here -->
<ul>
<li>y</li>
</ul>
</li>
</ul>
</ul>
o
o h2
o
o h4
or:
oo h2
oo h4
or:
o h2
o h4
This is browser dependent, and except the last one (which isn't the one
that will be rendered) they look somehow wrong to me.
Yet, the ToC macro is not really a problem, because it is macro, and the
WYSIWYG should not have to edit it. So, while the renderer could support
incorrectly nested lists, I'm still in favor of keeping the WYSIWYG
restrictive. This is the web, and this is a wiki, users should not waste
time making nicely indented lists, but meaningful correct lists.