Skip to content

Commit 5b7130e

Browse files
committed
Use img tag for SVG images
This commit changes the HTML tag which is used for SVG images from <object> to <img>. This fixes scalability of images on websites. Signed-off-by: Robert Winkler <rwinkler@antmicro.com>
1 parent 4e56be3 commit 5b7130e

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

sphinxcontrib_verilog_diagrams/__init__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -443,18 +443,13 @@ def render_diagram_html(
443443
if alt is None:
444444
alt = node.get('alt', self.encode(code).strip())
445445
imgcss = imgcls and 'class="%s"' % imgcls or ''
446-
if format == 'svg':
447-
svgtag = '''<object data="%s" type="image/svg+xml">
448-
<p class="warning">%s</p></object>\n''' % (fname, alt)
449-
self.body.append(svgtag)
450-
else:
451-
if 'align' in node:
452-
self.body.append('<div align="%s" class="align-%s">' %
453-
(node['align'], node['align']))
454-
self.body.append('<img src="%s" alt="%s" %s/>\n' %
455-
(fname, alt, imgcss))
456-
if 'align' in node:
457-
self.body.append('</div>\n')
446+
if 'align' in node:
447+
self.body.append('<div align="%s" class="align-%s">' %
448+
(node['align'], node['align']))
449+
self.body.append('<img src="%s" alt="%s" %s/>\n' %
450+
(fname, alt, imgcss))
451+
if 'align' in node:
452+
self.body.append('</div>\n')
458453

459454
raise nodes.SkipNode
460455

0 commit comments

Comments
 (0)