fixed nested <dl> - webdump - HTML to plain-text converter for webpages
(HTM) git clone git://git.codemadness.org/webdump
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 29ab23324d260dae10475498bfcabd06a4c9ba48
(DIR) parent bc435d97f57537adbce2b1ddac9f0744a57279ae
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 13 Sep 2023 20:38:58 +0200
fixed nested <dl>
Noticed on the page, for example:
http://man.openbsd.org/ftp
Diffstat:
M webdump.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/webdump.c b/webdump.c
@@ -1856,12 +1856,12 @@ xmltagstart(XMLParser *p, const char *t, size_t tl)
} else if (!tagcmp(t, "dt")) {
childs[0] = "dd";
nchilds = 1;
- parenttype = 0; /* seek until the root */
+ parenttype = DisplayDl;
} else if (!tagcmp(t, "dd")) {
childs[0] = "dd";
childs[1] = "dt";
nchilds = 2;
- parenttype = 0; /* seek until the root */
+ parenttype = DisplayDl;
} else if (!tagcmp(t, cur->tag.name)) {
/* fake closing the previous tag if it is the same and repeated */
xmltagend(p, t, tl, 0);
@@ -1871,7 +1871,7 @@ xmltagstart(XMLParser *p, const char *t, size_t tl)
childs[0] = "p";
childs[1] = "dl";
nchilds = 2;
- parenttype = 0; /* seek until the root */
+ parenttype = DisplayDl;
}
if (nchilds > 0) {