about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/fead.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fead.py b/src/fead.py
index 6efbe11..600dff0 100755
--- a/src/fead.py
+++ b/src/fead.py
@@ -33,7 +33,8 @@ from textwrap import shorten
 from urllib.error import HTTPError
 from urllib.parse import urljoin, urlsplit
 from warnings import warn
-from xml.etree.ElementTree import fromstring as parse_xml
+from xml.etree.ElementTree import (fromstring as parse_xml,
+                                   tostring as unparse_xml)
 
 REQUEST = 'GET {} HTTP/1.0\r\nHost: {}\r\n\r\n'
 HTML_TAG = regex('<.+?>')
@@ -119,7 +120,11 @@ def parse_atom_entry(xml):
         elif child.tag.endswith('Atom}summary'):
             summary = child.text
         elif child.tag.endswith('Atom}content') and not summary:
-            summary = child.text
+            if child.attrib.get('type') == 'xhtml':
+                assert len(child) == 1 and child[0].tag.endswith('xhtml}div')
+                summary = unparse_xml(child[0]).decode()
+            else:
+                summary = child.text
     return title, link, time, summary