Fix #3497 (Error on converting zip containing htm files w/ index.htm)

This commit is contained in:
Kovid Goyal 2009-09-17 10:39:53 -06:00
parent 089925ab1d
commit d32a92123c
2 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,8 @@ XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>')
SVG_NS = 'http://www.w3.org/2000/svg'
XLINK_NS = 'http://www.w3.org/1999/xlink'
convert_entities = functools.partial(entity_to_unicode, exceptions=['quot', 'apos', 'lt', 'gt', 'amp'])
convert_entities = functools.partial(entity_to_unicode, exceptions=['quot',
'apos', 'lt', 'gt', 'amp', '#60', '#62'])
_span_pat = re.compile('<span.*?</span>', re.DOTALL|re.IGNORECASE)

View File

@ -845,6 +845,7 @@ class Manifest(object):
if not namespace(data.tag):
data.attrib['xmlns'] = XHTML_NS
data = etree.tostring(data, encoding=unicode)
try:
data = etree.fromstring(data)
except: