Skip to content

Commit

Permalink
Fix sphinx-doc#7112: html: SVG image is not layouted as float even if…
Browse files Browse the repository at this point in the history
… aligned
  • Loading branch information
tk0miya committed Feb 8, 2020
1 parent 1e5342f commit 7707d31
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -69,6 +69,7 @@ Bugs fixed
----------

* #6925: html: Remove redundant type="text/javascript" from <script> elements
* #7112: html: SVG image is not layouted as float even if aligned
* #6906, #6907: autodoc: failed to read the source codes encoeded in cp1251
* #6961: latex: warning for babel shown twice
* #7059: latex: LaTeX compilation falls into infinite loop (wrapfig issue)
Expand Down
8 changes: 4 additions & 4 deletions sphinx/themes/basic/static/basic.css_t
Expand Up @@ -271,25 +271,25 @@ p.rubric {
font-weight: bold;
}

img.align-left, .figure.align-left, object.align-left {
img.align-left, .figure.align-left, object.align-left, div.img.align-left {
clear: left;
float: left;
margin-right: 1em;
}

img.align-right, .figure.align-right, object.align-right {
img.align-right, .figure.align-right, object.align-right, div.img.align-right {
clear: right;
float: right;
margin-left: 1em;
}

img.align-center, .figure.align-center, object.align-center {
img.align-center, .figure.align-center, object.align-center, div.img.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}

img.align-default, .figure.align-default {
img.align-default, .figure.align-default, div.img.align-default {
display: block;
margin-left: auto;
margin-right: auto;
Expand Down
2 changes: 1 addition & 1 deletion sphinx/writers/html.py
Expand Up @@ -609,7 +609,7 @@ def visit_image(self, node: Element) -> None:
atts['height'] = int(atts['height']) * scale
atts['alt'] = node.get('alt', uri)
if 'align' in node:
self.body.append('<div align="%s" class="align-%s">' %
self.body.append('<div align="%s" class="img align-%s">' %
(node['align'], node['align']))
self.context.append('</div>\n')
else:
Expand Down
2 changes: 1 addition & 1 deletion sphinx/writers/html5.py
Expand Up @@ -550,7 +550,7 @@ def visit_image(self, node: Element) -> None:
atts['height'] = int(atts['height']) * scale
atts['alt'] = node.get('alt', uri)
if 'align' in node:
self.body.append('<div align="%s" class="align-%s">' %
self.body.append('<div align="%s" class="img align-%s">' %
(node['align'], node['align']))
self.context.append('</div>\n')
else:
Expand Down

0 comments on commit 7707d31

Please sign in to comment.