UIKit0 / newsbeuter

Automatically exported from code.google.com/p/newsbeuter
0 stars 0 forks source link

Missing whitespace? #224

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The feeds
    http://lambda.jimpryor.net/recentchanges/index.rss
and
    http://lambda.jimpryor.net/recentchanges/index.atom

generated by ikiwiki for my own site, render in newsbeuter with the following
body:

    Changed pages:index[1]
    Changed by:profjim[2]
    Commit type:git
    Date:14:38:58 08/23/10OCaml -> Caml

Note the absence of any whitespace between the end of the date and the summary 
of the
change ("OCaml -> Caml"). There are several line breaks at that spot
in the source. I can't tell whether this is a defect in the feed generation or 
in the rendering. If it's the former, please let me know and I'll pursue with 
ikiwiki.

Using newsbeuter from git:

    newsbeuter 2.4 - http://www.newsbeuter.org/
    Copyright (C) 2006-2010 Andreas Krennmair

    newsbeuter is free software and licensed under the MIT/X Consortium License.
    Type `newsbeuter -vv' for more information.

    Compilation date/time: Aug 19 2010 13:14:56
    System: Linux 2.6.35-ARCH (x86_64)
    Compiler: g++ 4.5.1
    ncurses: ncurses 5.7.20081102 (compiled with 5.7)
    libcurl: libcurl/7.21.1 OpenSSL/1.0.0a zlib/1.2.5 (compiled with 7.21.1)
    SQLite: 3.7.0.1 (compiled with 3.7.0.1)
    libxml2: compiled with 2.7.7

Original issue reported on code.google.com by prof...@jimpryor.net on 23 Aug 2010 at 8:20

GoogleCodeExporter commented 9 years ago
The parser does not understand "<br/>". I think that the problem is that the 
'/' becomes a part of the tag name in this case.

I have made a quick and dirty fix:

--- ../../newsbeuter-2.4/src/tagsouppullparser.cpp      2011-02-01 
11:52:29.000000000 +0100
+++ tagsouppullparser.cpp       2011-03-03 23:32:22.710438472 +0100
@@ -486,8 +486,11 @@ void tagsouppullparser::parse_tag(const 
        while (last_pos != std::string::npos) {
                if (count == 0) {
                        // first token: tag name
-                       if (pos == std::string::npos)
+                       if (pos == std::string::npos) {
                                pos = tagstr.length();
+                               if (tagstr[tagstr.length()-1] == '/')
+                                       pos--;
+                       }
                        text = tagstr.substr(last_pos, pos - last_pos);
                        LOG(LOG_DEBUG, "parse_tag: tag name = %s", text.c_str());
                } else {

Original comment by mat...@gmail.com on 3 Mar 2011 at 10:47