with the -i and -a option highlight links in ANSI reverse - 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 bc435d97f57537adbce2b1ddac9f0744a57279ae (DIR) parent f4f2dc53e082fcbf627d567810c399c306009ea0 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Wed, 13 Sep 2023 20:38:27 +0200 with the -i and -a option highlight links in ANSI reverse Diffstat: M webdump.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) --- (DIR) diff --git a/webdump.c b/webdump.c @@ -1661,12 +1661,23 @@ endnode(struct node *cur) cur->tag.name, ishidden, linkcount); } + if (showrefinline || showurlinline) { + hflush(); + startmarkup(MarkupReverse); + } + if (showrefinline) hprintf("[%zu]", ref->linknr); - if (showurlinline) - hprintf(" [%s: %s]", ref->type, ref->url); - if (showrefinline || showurlinline) + if (showurlinline) { + if (!tagcmp("link", ref->type)) + hprintf("[%s]", ref->url); + else + hprintf("[%s: %s]", ref->type, ref->url); + } + if (showrefinline || showurlinline) { + endmarkup(MarkupReverse); hflush(); + } } handleendtag(&(cur->tag));