feeds: turns out lxml.etree doesn't have drop_tag

master
pictuga 2020-04-05 21:50:38 +02:00
parent eeac630855
commit aad2398e69
1 changed files with 6 additions and 5 deletions

View File

@ -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):