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 content.append(etree.fromstring('''<div
xmlns="http://www.w3.org/1999/xhtml">%s</div>''' % \ xmlns="http://www.w3.org/1999/xhtml">%s</div>''' % \
self.__atom_content.get('content'))) 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 # Emed the text in escaped form
elif not type or type.startswith('text') or type == 'html': elif not type or type.startswith('text') or type == 'html':
content.text = self.__atom_content.get('content') 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 # Everything else should be included base64 encoded
else: else:
raise ValueError('base64 encoded content is not supported at the moment.' raise ValueError('base64 encoded content is not supported at the moment.'