summaryrefslogtreecommitdiff
path: root/sfeed_frames.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2020-03-09 19:21:15 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-03-10 23:45:47 +0100
commit52cd6f7ad6a87b8419cfa8a0ffb6f8546b985e2f (patch)
tree6032ce7e89e2e93e4e1dbc45db00f1a14e6c1338 /sfeed_frames.c
parent991008dc460854b5f2f978a87946f9d90e3e5ee5 (diff)
sfeed_html/sfeed_frames: use a <pre> section per feed
This improves output with Dillo, w3m and possibly other simple browsers. - Dillo has a bug where it resets its block-style after <h2> when it is inside <pre>. Then it ignores newlines (inside <pre>) and the links are inlined. - w3m does not have a (line)margin for h2.
Diffstat (limited to 'sfeed_frames.c')
-rw-r--r--sfeed_frames.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 16d7871..f367bec 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -33,6 +33,7 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f)
xmlencode(f->name, fpitems);
fputs("</a></h2>\n", fpitems);
}
+ fputs("<pre>\n", fpitems);
while ((linelen = getline(&line, &linesize, fpin)) > 0) {
if (line[linelen - 1] == '\n')
@@ -69,6 +70,7 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f)
fputs("</u></b>", fpitems);
fputs("\n", fpitems);
}
+ fputs("</pre>\n", fpitems);
}
int
@@ -108,7 +110,7 @@ main(int argc, char *argv[])
"\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
"\t<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n"
"</head>\n"
- "<body class=\"frame\"><div id=\"items\"><pre>\n", fpitems);
+ "<body class=\"frame\"><div id=\"items\">", fpitems);
if (argc == 1) {
if (!(feeds[0] = calloc(1, sizeof(struct feed))))
@@ -130,7 +132,7 @@ main(int argc, char *argv[])
fclose(fp);
}
}
- fputs("</pre>\n</div></body>\n</html>\n", fpitems); /* div items */
+ fputs("</div></body>\n</html>\n", fpitems); /* div items */
if (showsidebar) {
fputs("<!DOCTYPE HTML>\n"