]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - rss2maildir.py
Update li handling a bit, and make the expected test results be what we'd
[rss2maildir.git] / rss2maildir.py
index 7acbe54966ae02ff2cfaaf7cd3d67bb49cb0eb09..3e4ed605d1eaa7669e1faccd25904449d2a6596b 100755 (executable)
@@ -227,7 +227,9 @@ class HTML2Text(HTMLParser):
         elif self.inpre:
             self.text = self.text + unicode(data, "utf-8")
         else:
-            self.text = self.text + unicode(data, "utf-8").strip() + u' '
+            isallwhitespace = data.strip()
+            if isallwhitespace != "" and self.text[-1] == "\n":
+                self.text = self.text + unicode(data, "utf-8").strip() + u' '
 
     def handle_entityref(self, name):
         entity = name