mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
EPUB Output: Fix handling of self closing <audio> tags. Fixes #906521 (Epub conversion adds a </a> tag to <audio> tags)
This commit is contained in:
parent
da1d67a3fb
commit
bd741c1934
@ -942,7 +942,12 @@ class Manifest(object):
|
||||
if isinstance(data, etree._Element):
|
||||
ans = xml2str(data, pretty_print=self.oeb.pretty_print)
|
||||
if self.media_type in OEB_DOCS:
|
||||
ans = re.sub(r'<(div|a|span)([^>]*)/>', r'<\1\2></\1>', ans)
|
||||
# Convert self closing div|span|a tags to normally closed
|
||||
# ones, as they are interpreted incorrectly by some browser
|
||||
# based renderers
|
||||
ans = re.sub(
|
||||
r'<(?P<tag>div|a|span)(?=[\s/])(?P<arg>[^>]*)/\s*>',
|
||||
r'<\g<tag>\g<arg>></\g<tag>>', ans)
|
||||
return ans
|
||||
if isinstance(data, unicode):
|
||||
return data.encode('utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user