Opened 19 years ago

Closed 17 years ago

#2 closed defect (fixed)

Does not handle changes in header depth gracefully

Reported by: Alec Thomas Owned by: Christian Boos
Priority: low Component: TocMacro
Severity: normal Keywords:
Cc: sns@… Trac Release: 0.11


If headers jump more than one level at a time, eg. from == to ====, the TocMacro will display <li> entries for intervening header levels. This is not ideal.

Attachments (0)

Change History (5)

comment:1 Changed 19 years ago by Steven N. Severinghaus <sns@…>

Cc: sns@… added; anonymous removed

I have a patch (or at least some svn diff output, if that's usable) for the TOC macro that makes it output valid HTML. It's not particularly clean code, but it seems to handle all the weird cases that I threw at it fairly well. You can find my test case (in my wiki's SandBox) here (valid!), and you can find the diff on my website here. The full source is here.

I should have done this in two stages, but this version also includes a relatively small modification (for which there is a diff without the above changes here) that does the traditional outline numbering and adds a depth-based CSS class to each <ol> . The example in our sandbox shows both of these.

You can remove the inline styles (the style="list-style-type: ...;" part) and just add some CSS statements like this, if you want:

ol.toc-depth1 { list-style-type: upper-roman; }
ol.toc-depth2 { list-style-type: upper-alpha; }
ol.toc-depth3 { list-style-type: decimal; }

This would be somewhat cleaner and less redundant, I suppose.

comment:2 Changed 19 years ago by Alec Thomas

milestone: 1.00.9
version: 0.1stable

comment:3 Changed 18 years ago by Alec Thomas

milestone: 0.9

Milestone 0.9 deleted

comment:4 Changed 17 years ago by Christian Boos

Owner: changed from Alec Thomas to Christian Boos
Trac Release: 0.11

This is still present in the 0.11 branch, mostly annoying with the inline mode.

comment:5 Changed 17 years ago by Christian Boos

Resolution: fixed
Status: newclosed

(In [1907]) The outline tree is now much nicer in inline mode, as there won't be a new entry for each sublevel. Rather, the previous entry will be reused if available. Plus other validation fixes (the TOC macro now always validates).

Fixes #2.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.