This commit is contained in:
Kovid Goyal 2012-01-15 10:59:19 +05:30
parent 466f73159e
commit ed603d914b

View File

@ -942,12 +942,12 @@ class Manifest(object):
if isinstance(data, etree._Element): if isinstance(data, etree._Element):
ans = xml2str(data, pretty_print=self.oeb.pretty_print) ans = xml2str(data, pretty_print=self.oeb.pretty_print)
if self.media_type in OEB_DOCS: if self.media_type in OEB_DOCS:
# Convert self closing div|span|a tags to normally closed # Convert self closing div|span|a|video|audio|iframe tags
# ones, as they are interpreted incorrectly by some browser # to normally closed ones, as they are interpreted
# based renderers # incorrectly by some browser based renderers
ans = re.sub( ans = re.sub(
# tag name followed by either a space or a / # tag name followed by either a space or a /
r'<(?P<tag>div|a|span)(?=[\s/])(?P<arg>[^>]*)/>', r'<(?P<tag>div|a|span|video|audio|iframe)(?=[\s/])(?P<arg>[^>]*)/>',
r'<\g<tag>\g<arg>></\g<tag>>', ans) r'<\g<tag>\g<arg>></\g<tag>>', ans)
return ans return ans
if isinstance(data, unicode): if isinstance(data, unicode):