sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit f869ea9ce274aaefb04963e51462700d9fd74232
parent 52cd6f7ad6a87b8419cfa8a0ffb6f8546b985e2f
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon,  9 Mar 2020 19:23:07 +0100

sfeed_html/sfeed_frames: fix bold markup for lynx

The previous style was not bold:
<b><a href="">some link</a></b>

The following link is now bold:
<a href=""><b>some link</b></a>

Diffstat:
Msfeed_frames.c | 11+++++------
Msfeed_html.c | 12++++++------
2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/sfeed_frames.c b/sfeed_frames.c @@ -55,19 +55,18 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) fprintf(fpitems, "%04d-%02d-%02d&nbsp;%02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); - if (isnew) - fputs("<b><u>", fpitems); if (fields[FieldLink][0]) { fputs("<a href=\"", fpitems); xmlencode(fields[FieldLink], fpitems); fputs("\">", fpitems); - xmlencode(fields[FieldTitle], fpitems); - fputs("</a>", fpitems); - } else { - xmlencode(fields[FieldTitle], fpitems); } if (isnew) + fputs("<b><u>", fpitems); + xmlencode(fields[FieldTitle], fpitems); + if (isnew) fputs("</u></b>", fpitems); + if (fields[FieldLink][0]) + fputs("</a>", fpitems); fputs("\n", fpitems); } fputs("</pre>\n", fpitems); diff --git a/sfeed_html.c b/sfeed_html.c @@ -55,19 +55,19 @@ printfeed(FILE *fp, struct feed *f) fprintf(stdout, "%04d-%02d-%02d&nbsp;%02d:%02d ", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); - if (isnew) - fputs("<b><u>", stdout); + if (fields[FieldLink][0]) { fputs("<a href=\"", stdout); xmlencode(fields[FieldLink], stdout); fputs("\">", stdout); - xmlencode(fields[FieldTitle], stdout); - fputs("</a>", stdout); - } else { - xmlencode(fields[FieldTitle], stdout); } if (isnew) + fputs("<b><u>", stdout); + xmlencode(fields[FieldTitle], stdout); + if (isnew) fputs("</u></b>", stdout); + if (fields[FieldLink][0]) + fputs("</a>", stdout); fputs("\n", stdout); } fputs("</pre>\n", stdout);