Support for ePub builder

This commit is contained in:
Kujiu 2020-07-31 15:42:00 +02:00
parent 0a954221e1
commit 75189517f4
Signed by: kujiu
GPG key ID: ABBB2CAC6855599F

View file

@ -46,11 +46,13 @@ def html_visit_fa(self: HTMLTranslator, node: fa) -> None:
label_uid = uuid.uuid4()
title = None
options = 'role="img"'
options += ' xmlns="http://www.w3.org/2000/svg"'
options += ' xmlns:xlink="http://www.w3.org/1999/xlink"'
if node.get('alt', None):
options += ' aria-labelledby="fa_%s"' % label_uid
title = '<title id="%s">%s</title>' % (label_uid, node['alt'])
else:
options += ' aria-hidden="true"'
options += ' aria-hidden="true" xlink:title=""'
if node.get('html_id', None):
options += ' id="%s"' % node['html_id']
@ -119,7 +121,10 @@ def html_visit_falink(self: HTMLTranslator, node: fa) -> None:
'<a class="fasvglink %s" href="%s">' %
(node['icon'], node['url']))
self.body.append(
'<svg aria-hidden="true" class="icon" role="img">'
'<svg aria-hidden="true" class="icon" role="img"'
+ ' xlink:title=""'
+ ' xmlns="http://www.w3.org/2000/svg"'
+ ' xmlns:xlink="http://www.w3.org/1999/xlink">'
)
self.body.append(