Fixed bug with non-existing type attributes

This commit is contained in:
Lars Kiesow 2013-09-29 19:48:33 +02:00
parent 6b2a2a5232
commit eb5c285952

View file

@ -105,12 +105,12 @@ class FeedEntry(object):
content.append(etree.fromstring('''<div
xmlns="http://www.w3.org/1999/xhtml">%s</div>''' % \
self.__atom_content.get('content')))
# Parse XML and embed it
elif type.endswith('/xml') or type.endswith('+xml'):
content.append(etree.fromstring(self.__atom_content['content']))
# Emed the text in escaped form
elif not type or type.startswith('text') or type == 'html':
content.text = self.__atom_content.get('content')
# Parse XML and embed it
elif type.endswith('/xml') or type.endswith('+xml'):
content.append(etree.fromstring(self.__atom_content['content']))
# Everything else should be included base64 encoded
else:
raise ValueError('base64 encoded content is not supported at the moment.'