mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2672 (Error downloading built-in news recipe for El Mundo with 0.6b8)
This commit is contained in:
parent
6459a6c256
commit
50a1346611
@ -785,10 +785,12 @@ class Manifest(object):
|
||||
data = first_pass(data)
|
||||
# Force into the XHTML namespace
|
||||
if barename(data.tag) != 'html':
|
||||
data = first_pass('<html>'+data+'</html>')
|
||||
if barename(data.tag) != 'html':
|
||||
raise NotHTML(
|
||||
'File %r does not appear to be (X)HTML' % self.href)
|
||||
self.log.warn('File %r does not appear to be (X)HTML'%self.href)
|
||||
nroot = etree.fromstring('<html></html>')
|
||||
for child in list(data):
|
||||
child.getparent.remove(child)
|
||||
nroot.append(child)
|
||||
data = nroot
|
||||
elif not namespace(data.tag):
|
||||
data.attrib['xmlns'] = XHTML_NS
|
||||
data = etree.tostring(data, encoding=unicode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user