diff --git a/morss/feeds.py b/morss/feeds.py index 9eee168..0cf7670 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -402,13 +402,14 @@ class ParserXML(ParserBase): else: if html_rich: - # atom stuff - if 'atom' in rule: - match.attrib['type'] = 'xhtml' - self._clean_node(match) match.append(lxml.html.fragment_fromstring(value, create_parent='div')) - match.find('div').drop_tag() + + if self.rules['mode'] == 'html': + match.find('div').drop_tag() # not supported by lxml.etree + + else: # i.e. if atom + match.attrib['type'] = 'xhtml' else: if match is not None and len(match):