From 52cd6f7ad6a87b8419cfa8a0ffb6f8546b985e2f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 9 Mar 2020 19:21:15 +0100 Subject: sfeed_html/sfeed_frames: use a
 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 

when it is inside
. Then it ignores newlines (inside 
) and the links are inlined.
- w3m does not have a (line)margin for h2.
---
 sfeed_frames.c | 6 ++++--
 sfeed_html.c   | 5 +++--
 2 files changed, 7 insertions(+), 4 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("

\n", fpitems); } + fputs("
\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("", fpitems);
 		fputs("\n", fpitems);
 	}
+	fputs("
\n", fpitems); } int @@ -108,7 +110,7 @@ main(int argc, char *argv[]) "\t\n" "\t\n" "\n" - "
\n", fpitems);
+	      "
", fpitems); if (argc == 1) { if (!(feeds[0] = calloc(1, sizeof(struct feed)))) @@ -130,7 +132,7 @@ main(int argc, char *argv[]) fclose(fp); } } - fputs("
\n
\n\n", fpitems); /* div items */ + fputs("\n\n", fpitems); /* div items */ if (showsidebar) { fputs("\n" diff --git a/sfeed_html.c b/sfeed_html.c index 8f104b7..3afd18f 100644 --- a/sfeed_html.c +++ b/sfeed_html.c @@ -33,6 +33,7 @@ printfeed(FILE *fp, struct feed *f) xmlencode(f->name, stdout); fputs("\n", stdout); } + fputs("
\n", stdout);
 
 	while ((linelen = getline(&line, &linesize, fp)) > 0) {
 		if (line[linelen - 1] == '\n')
@@ -69,6 +70,7 @@ printfeed(FILE *fp, struct feed *f)
 			fputs("", stdout);
 		fputs("\n", stdout);
 	}
+	fputs("
\n", stdout); } int @@ -103,7 +105,6 @@ main(int argc, char *argv[]) fputs("\t\t
\n", stdout); else fputs("\t\t
\n", stdout); - fputs("
\n", stdout);
 
 	if (argc == 1) {
 		if (!(feeds[0] = calloc(1, sizeof(struct feed))))
@@ -126,7 +127,7 @@ main(int argc, char *argv[])
 			fclose(fp);
 		}
 	}
-	fputs("
\n
\n", stdout); /* div items */ + fputs("
\n", stdout); /* div items */ if (showsidebar) { fputs("\t
\n\t\t
    \n", stdout); -- cgit v1.2.3