From 237237b92d00ac9d15bbe01c7d13ec6fb0fb850c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 14 Dec 2015 22:03:50 -0800 Subject: HTML doc: fix back jumping flaw. Issue: wrong [+] changes to [-], leading to inconsistent state. * genman.txr: In TOC extraction and transformation, we fix the stupid broken
....
that man2html puts out and turn it into
...
. This way a DL now has a DT element as its previous sibling. (tocjump): When we see a DL now, we get the correct element which has the expand/collapse: the previous sibling which is a DT containing the anchor. --- genman.txr | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'genman.txr') diff --git a/genman.txr b/genman.txr index 0b7c61c5..cfc8e00f 100644 --- a/genman.txr +++ b/genman.txr @@ -74,8 +74,13 @@ Content-type: text/html @(collect :vars (TOC)) @ (some) @ (cases) +@ (cases) +
@num @rest
+@ (or)
@num @rest -@ (bind TOC `
@num @rest`) +
+@ (end) +@ (bind TOC `
@num @rest
`) @ (or) @(skip) @ (output :into TOC) @@ -96,7 +101,7 @@ Content-type: text/html @ (do (mapdo (do unless [tgthash @1] (set [tgthash @1] [tagmap tag])) sym)) @ (and) -
@num @rest +
@num @nil
@ (cat TOC) @ (bind pos @(car (search-regex TOC #/ 0) - atoggles[0].innerHTML = '@opentxt'; + if (dt !== null) { + var atoggles = dt.getElementsByClassName("toggle"); + if (atoggles.length > 0) + atoggles[0].innerHTML = '@opentxt'; + } } } } -- cgit v1.2.3