$NetBSD: patch-aa,v 1.6 2008/10/19 18:39:56 schmonz Exp $

Small cleanup patch from Debian.

--- html2text.py.orig	2011-03-08 23:35:25.000000000 +0000
+++ html2text.py
@@ -305,6 +305,7 @@ class _html2text(HTMLParser.HTMLParser):
             if has_key(attrs, 'src'):
                 attrs['href'] = attrs['src']
                 alt = attrs.get('alt', '')
+                alt = re.sub('\n', ' ', alt)
                 i = self.previousIndex(attrs)
                 if i is not None:
                     attrs = self.a[i]
@@ -325,7 +326,7 @@ class _html2text(HTMLParser.HTMLParser):
         if tag in ["ol", "ul"]:
             if start:
                 self.list.append({'name':tag, 'num':0})
-            else:
+            elif self.list:
                 if self.list: self.list.pop()
             
             self.p()
