summaryrefslogtreecommitdiff
path: root/sfeed_html.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-07-31 21:06:52 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-07-31 21:12:07 +0200
commit356e7d79925f91b9b703ee63e3680694c53a59a4 (patch)
treebc06b59ee637c2695055b62221abad696d66eb7c /sfeed_html.c
parenteb586eda26967183de91c314a57d323b124110bb (diff)
Various improvements
- Only escape characters in "content" field, these can contain newlines. - Trim newlines and tabs, etc from the title, id and author fields. - Make decodefield, xmlencode functions easier to "chain" without allocatting new buffers. - Move printutf8pad from util (only used by sfeed_plain) to sfeed_plain. - Update README, still need to update the man-page and improve the documentation in general. - Code cleanup.
Diffstat (limited to 'sfeed_html.c')
-rw-r--r--sfeed_html.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sfeed_html.c b/sfeed_html.c
index efd39db..545537e 100644
--- a/sfeed_html.c
+++ b/sfeed_html.c
@@ -24,11 +24,11 @@ printfeed(FILE *fp, struct feed *f)
if (f->name[0] != '\0') {
fputs("<h2 id=\"", stdout);
- printxmlencoded(f->name, stdout);
+ print(f->name, stdout, xmlencode);
fputs("\"><a href=\"#", stdout);
- printxmlencoded(f->name, stdout);
+ print(f->name, stdout, xmlencode);
fputs("\">", stdout);
- printxmlencoded(f->name, stdout);
+ print(f->name, stdout, xmlencode);
fputs("</a></h2>\n", stdout);
}
fputs("<table cellpadding=\"0\" cellspacing=\"0\">\n", stdout);
@@ -53,10 +53,10 @@ printfeed(FILE *fp, struct feed *f)
fputs("<b><u>", stdout);
if (islink) {
fputs("<a href=\"", stdout);
- printxmlencoded(fields[FieldLink], stdout);
+ print(fields[FieldLink], stdout, xmlencode);
fputs("\">", stdout);
}
- printxmlencoded(fields[FieldTitle], stdout);
+ print(fields[FieldTitle], stdout, xmlencode);
if (islink)
fputs("</a>", stdout);
if (isnew)
@@ -126,11 +126,11 @@ main(int argc, char *argv[])
fputs("<li class=\"n\"><a href=\"#", stdout);
else
fputs("<li><a href=\"#", stdout);
- printxmlencoded(f->name, stdout);
+ print(f->name, stdout, xmlencode);
fputs("\">", stdout);
if (f->totalnew > 0)
fputs("<b><u>", stdout);
- printxmlencoded(f->name, stdout);
+ print(f->name, stdout, xmlencode);
fprintf(stdout, " (%lu)", f->totalnew);
if (f->totalnew > 0)
fputs("</u></b>", stdout);