tsimplify link reference type, remove ifdefs and some debug code - webdump - [FORK] git://git.codemadness.org/webdump
(HTM) git clone git://git.z3bra.org/webdump.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 1cea64472638b69e7c4747729e33a15c58cab5d9
(DIR) parent 044d586ba0ed57e8cba46603e68a6392a22b3511
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 8 Dec 2019 16:09:00 +0100
simplify link reference type, remove ifdefs and some debug code
Diffstat:
M webdump.c | 31 +------------------------------
1 file changed, 1 insertion(+), 30 deletions(-)
---
(DIR) diff --git a/webdump.c b/webdump.c
t@@ -529,8 +529,6 @@ xmldataend(XMLParser *p)
cur = &nodes[curnode];
-// printf("DEBUG: node: %s, type: %d\n", cur->tagname, cur->tag.displaytype);
-
if ((cur->tag.displaytype & DisplayNone)) {
/* nothing */
} else if ((cur->tag.displaytype & DisplayPre) ||
t@@ -585,8 +583,6 @@ xmltagstart(XMLParser *x, const char *t, size_t tl)
struct node *cur;
int i;
-// printf("DEBUG: start of tag: %s\n", t);
-
if (curnode >= MAX_DEPTH - 2)
errx(1, "max tag depth reached: %d\n", curnode);
curnode++;
t@@ -616,9 +612,6 @@ xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
cur = &nodes[curnode];
-// printf("DEBUG: end of tag: %s, %d, node tag: %s\n", t,
-// cur->tag.displaytype, cur->tagname);
-
if (cur->tag.displaytype & DisplayBold)
printansi("\033[22m"); /* reset bold or faint */
if (cur->tag.displaytype & DisplayItalic)
t@@ -703,33 +696,11 @@ xmltagstartparsed(XMLParser *p, const char *t, size_t tl, int isshort)
links_cur->url = estrdup(absurl);
printf(" [%d]", ++linkcount);
- if (!strcasecmp(t, "img") || !strcasecmp(t, "video") ||
- !strcasecmp(t, "audio")) {
- links_cur->type = estrdup(t);
- } else {
- links_cur->type = estrdup("link");
- }
-
+ links_cur->type = estrdup(t);
}
src[0] = '\0';
}
-#if 0
- /* show links inline */
- if (src[0]) {
- char absurl[1024];
- if (absuri(absurl, sizeof(absurl), src, basehref) != -1) {
- if (!strcasecmp(t, "img") || !strcasecmp(t, "video") ||
- !strcasecmp(t, "audio"))
- printf("[%s](", t);
- else
- printf("[%s](", "link");
- printsafe(absurl, strlen(absurl));
- putchar(')');
- }
- }
-#endif
-
/* find first parent node of type and increase child node count */
if (cur->tag.parenttype && (parent = findparentoftype(curnode)))
parent->nchildren++;