tscrape_html: use a <pre> section per feed - tscrape - twitter scraper
 (HTM) git clone git://git.codemadness.org/tscrape
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c427d54a874baa5c3f0cd0d725b90efa27cf34d2
 (DIR) parent b0413f42bd2bc31cbbb5e338093de51b94cfd028
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Fri, 20 Mar 2020 18:15:12 +0100
       
       tscrape_html: 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:
         M tscrape_html.c                      |       5 +++--
       
       1 file changed, 3 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/tscrape_html.c b/tscrape_html.c
       @@ -31,6 +31,7 @@ printfeed(FILE *fp, struct feed *f)
                        xmlencode(f->name, stdout);
                        fputs("</a></h2>\n", stdout);
                }
       +        fputs("<pre>\n", stdout);
        
                while ((linelen = getline(&line, &linesize, fp)) > 0) {
                        if (line[linelen - 1] == '\n')
       @@ -86,6 +87,7 @@ printfeed(FILE *fp, struct feed *f)
        
                        fputs("\n", stdout);
                }
       +        fputs("</pre>\n", stdout);
        }
        
        int
       @@ -119,7 +121,6 @@ main(int argc, char *argv[])
                        fputs("\t\t<div id=\"items\">\n", stdout);
                else
                        fputs("\t\t<div id=\"items\" class=\"nosidebar\">\n", stdout);
       -        fputs("<pre>", stdout);
        
                if (argc == 1) {
                        if (!(feeds[0] = calloc(1, sizeof(struct feed))))
       @@ -142,7 +143,7 @@ main(int argc, char *argv[])
                                fclose(fp);
                        }
                }
       -        fputs("</pre>\n</div>\n", stdout); /* div items */
       +        fputs("</div>\n", stdout); /* div items */
        
                if (showsidebar) {
                        fputs("\t<div id=\"sidebar\">\n\t\t<ul>\n", stdout);