TitleSuperfluous ul and li tags in the Table of Contents
Date15-Oct-2005 14:54:06 EEST
Version2.2.28
SubmitterChrisWilson
Bug criticalityJSPWiki:LightBug
Browser version
Bug statusClosedBug
PageProvider used
Servlet Containerjakarta-tomcat-5.0.29
Operating SystemFedora Core 4
URL
Java version1.5.0.5

(Copied from Bug Reports by Chris Wilson, not reproduced)

When using the Table of Contents plugin there seem to be superfluous <ul> and <li> tags. This result in a lot of space between the title and the TOC list.

(anonymous)


As far as I can tell, the code generated is entirely XHTML compliant. I would need to know what exactly is wrong with it in order to fix it... If there is a lot of space, one should tweak the CSS to display it correctly.

-- JanneJalkanen

I confirm the bug - and although it may be possible to do something with CSS, I failed to manage. It will be rather strange CSS, because you have to make a level of ul disappear, but not the next level contained in it. Here is the start of a typical TOC rendering:

<h4>Table of Contents</h4>
<ul>
  <li><ul>
    <li>Requirements!!</li>
    <li>Installation/li>
  ...

The problem is that the first level ul/li is empty except that it contains the second level ul. This may have been done to create deeper indentation, but that could easily be done with CSS. Desriabel rendering would be:

<h4>Table of Contents</h4>
<ul>
  <li>Requirements!!</li>
  <li>Installation/li>
  ...

Gregor Hagedorn

Hmm... Wikipedia seems to do something similar (with class identifiers for each indent level). Maybe it might be easier to render. Re-opening.

-- JanneJalkanen

Okay. Fixed in 2.3.32. It looks a LOT better now with the default CSS. Here's a sample of the generated markup:

<div class="toc">
<h4>Table of Contents</h4>
<ul>
<li class="toclevel-2"><a class="wikipage" href="...">Requirements!!!!</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Installation</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Support and documentation</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Download files</a></li>
<li class="toclevel-3"><a class="wikipage" href="...">[Current stable release] : v2.2.33</a></li>
<li class="toclevel-3"><a class="wikipage" href="...">[Current BETA release] : none</a></li>
<li class="toclevel-3"><a class="wikipage" href="...">[The latest cutting-edge code of JSPWiki 2] : v2.3.27</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Ready-built packages</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Contributions and patches</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Current known bugs and workarounds</a></li>
<li class="toclevel-2"><a class="wikipage" href="...">Older releases</a></li>
</ul>
</div>

-- JanneJalkanen

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-7) was last changed on 18-Oct-2005 00:27 by Administrator