37b23f61ad
2008-10-09: 2.34. elim extra \ns (tx Keith Bussell) 2008-09-19: 2.33. add support for abbr (tx Nathan Youngman) 2008-07-31: 2.32. fix parsing bug with fastcompany (tx Elias Soong)
21 lines
789 B
Text
21 lines
789 B
Text
$NetBSD: patch-aa,v 1.6 2008/10/19 18:39:56 schmonz Exp $
|
|
|
|
--- html2text.py.orig 2008-10-19 14:36:07.000000000 -0400
|
|
+++ html2text.py
|
|
@@ -282,6 +282,7 @@ class _html2text(sgmllib.SGMLParser):
|
|
if attrs.has_key('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]
|
|
@@ -302,7 +303,7 @@ class _html2text(sgmllib.SGMLParser):
|
|
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()
|