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)
|
data = first_pass(data)
|
||||||
# Force into the XHTML namespace
|
# Force into the XHTML namespace
|
||||||
if barename(data.tag) != 'html':
|
if barename(data.tag) != 'html':
|
||||||
data = first_pass('<html>'+data+'</html>')
|
self.log.warn('File %r does not appear to be (X)HTML'%self.href)
|
||||||
if barename(data.tag) != 'html':
|
nroot = etree.fromstring('<html></html>')
|
||||||
raise NotHTML(
|
for child in list(data):
|
||||||
'File %r does not appear to be (X)HTML' % self.href)
|
child.getparent.remove(child)
|
||||||
|
nroot.append(child)
|
||||||
|
data = nroot
|
||||||
elif not namespace(data.tag):
|
elif not namespace(data.tag):
|
||||||
data.attrib['xmlns'] = XHTML_NS
|
data.attrib['xmlns'] = XHTML_NS
|
||||||
data = etree.tostring(data, encoding=unicode)
|
data = etree.tostring(data, encoding=unicode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user