Looking at the latest checkins, I suggest replacing:
/* Scan links that should be added to the index. */
var index_links = document.querySelectorAll
("td.printindex-index-entry a");
by:
/* Scan links that should be added to the index. */
var index_links = document.querySelectorAll
("td.printindex-index-entry");
and passing the td elements to cache_index_links.
The latter can then do the apropriate logic to deal with entries and subentries:
(1) Keep tack of most recent level-0 and level-1 entries.
(2) If there is a child/grand-child <a> element, check to see if it is level-1
or level-2 entry,
If so prepend the saved level-0 and level-2 text (followed by ", ") to the link
text.
Then add the entry to the dictionary.
I can implement this once the output is stable.
Before I do that, I suggest cleaning up the generated html a bit, as discussed:
- Get rid of the dummy <td></td> table cells used for indentation.
- Get rid of the extra <span class="index-entry-level-1"> elements. Move the
class="index-entry-level-1"
to either the <td> element (preferably) or the <a> element.
- Consider getting rid of empty <td class="printindex-index-section"></td>
elements, or
at least removing the class attribute. (Whichever is preferable may depend on
the line
is styled, such as when table borders are added.)
--
--Per Bothner
[email protected] http://per.bothner.com/