Skip to content

Commit 5dd51d7

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 835918b commit 5dd51d7

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
@@ -380,18 +380,13 @@ def render_diagram_html(
380380
if alt is None:
381381
alt = node.get('alt', self.encode(code).strip())
382382
imgcss = imgcls and 'class="%s"' % imgcls or ''
383-
if format == 'svg':
384-
svgtag = '''<object data="%s" type="image/svg+xml">
385-
<p class="warning">%s</p></object>\n''' % (fname, alt)
386-
self.body.append(svgtag)
387-
else:
388-
if 'align' in node:
389-
self.body.append('<div align="%s" class="align-%s">' %
390-
(node['align'], node['align']))
391-
self.body.append('<img src="%s" alt="%s" %s/>\n' %
392-
(fname, alt, imgcss))
393-
if 'align' in node:
394-
self.body.append('</div>\n')
383+
if 'align' in node:
384+
self.body.append('<div align="%s" class="align-%s">' %
385+
(node['align'], node['align']))
386+
self.body.append('<img src="%s" alt="%s" %s/>\n' %
387+
(fname, alt, imgcss))
388+
if 'align' in node:
389+
self.body.append('</div>\n')
395390

396391
raise nodes.SkipNode
397392

0 commit comments

Comments
 (0)