summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2014-06-24 14:52:59 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2014-06-24 14:52:59 +0000
commit4d1a7696d98161a3f838cdf3f43b4be7453f7296 (patch)
tree58bd12b938a1a487d8f6a3c1734c08b687a4802b /docutils
parentdf7346c66586dbf9181e48b1eb61f9f40dcd2d7f (diff)
downloaddocutils-4d1a7696d98161a3f838cdf3f43b4be7453f7296.tar.gz
Fix [258] figwidth="image" generates unitless width value.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7753 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/parsers/rst/directives/images.py2
-rw-r--r--docutils/writers/html4css1/__init__.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/docutils/parsers/rst/directives/images.py b/docutils/parsers/rst/directives/images.py
index 7c45ddc0a..ccb5bad4c 100644
--- a/docutils/parsers/rst/directives/images.py
+++ b/docutils/parsers/rst/directives/images.py
@@ -134,7 +134,7 @@ class Figure(Image):
else:
self.state.document.settings.record_dependencies.add(
imagepath.replace('\\', '/'))
- figure_node['width'] = img.size[0]
+ figure_node['width'] = '%dpx' % img.size[0]
del img
elif figwidth is not None:
figure_node['width'] = figwidth
diff --git a/docutils/writers/html4css1/__init__.py b/docutils/writers/html4css1/__init__.py
index 15b649710..aafc1322b 100644
--- a/docutils/writers/html4css1/__init__.py
+++ b/docutils/writers/html4css1/__init__.py
@@ -1047,9 +1047,9 @@ class HTMLTranslator(nodes.NodeVisitor):
self.settings.record_dependencies.add(
imagepath.replace('\\', '/'))
if 'width' not in atts:
- atts['width'] = str(img.size[0])
+ atts['width'] = '%dpx' % img.size[0]
if 'height' not in atts:
- atts['height'] = str(img.size[1])
+ atts['height'] = '%dpx' % img.size[1]
del img
for att_name in 'width', 'height':
if att_name in atts: