tprint reset sequence first, some small cleanups - 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 d6a93314849f631b92ff6023e6e3bd0c2e7ca1ce
(DIR) parent 698358715695476320282cec4ced913cb7395555
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 21 Nov 2019 00:43:46 +0100
print reset sequence first, some small cleanups
Diffstat:
M webdump.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
---
(DIR) diff --git a/webdump.c b/webdump.c
t@@ -121,12 +121,6 @@ static struct tag tags[] = {
{ "u", DisplayInline | DisplayUnderline },
{ "strong", DisplayInline | DisplayBold },
{ "em", DisplayInline | DisplayItalic },
-#if 0
- { "a", DisplayInline },
- { "span", DisplayInline },
- { "img", DisplayInline },
- { "label", DisplayInline },
-#endif
/* table */
{ "table", DisplayTable },
/* table-row */
t@@ -588,6 +582,10 @@ xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
// printf("DEBUG: end of tag: %s, %d, node tag: %s\n", t,
// cur->tag.displaytype, cur->tagname);
+ if (allowesc &&
+ cur->tag.displaytype & (DisplayBold | DisplayItalic | DisplayUnderline))
+ fputs("\033[0m", stdout); /* reset */
+
if (cur->tag.displaytype & DisplayBlock) {
newline();
} else if (cur->tag.displaytype & DisplayPre) {
t@@ -600,6 +598,7 @@ xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
newline();
} else if (cur->tag.displaytype & DisplayHeader) {
newline();
+#if 1
if (tl == 2 && t[0] == 'h' && t[1] >= '1' && t[1] <= '6') {
if (t[1] >= '3')
for (i = 0; i < termwidth; i++)
t@@ -609,12 +608,9 @@ xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
putchar('=');
newline();
}
+#endif
}
- if (allowesc &&
- cur->tag.displaytype & (DisplayBold | DisplayItalic | DisplayUnderline))
- fputs("\033[0m", stdout); /* reset */
-
/* specific tag handling */
if (!strcasecmp(t, "br")) {
newline();