From 531d70989f318f0821061ff1224b2c8b97402a43 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 12 Jan 2014 19:28:47 +0100 Subject: [PATCH] Closes #1198: Allow "image" for the "figwidth" option of the :rst:dir:`figure` directive as documented by docutils. --- CHANGES | 3 +++ sphinx/directives/__init__.py | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index a7dd57209..480ee39fa 100644 --- a/CHANGES +++ b/CHANGES @@ -69,6 +69,9 @@ Bugs fixed * #1233: Allow finding both Python classes and exceptions with the "class" and "exc" roles in intersphinx. +* #1198: Allow "image" for the "figwidth" option of the :rst:dir:`figure` + directive as documented by docutils. + Documentation ------------- diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index d2b70b82f..3133b7e35 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -12,7 +12,6 @@ import re from docutils.parsers.rst import Directive, directives -from docutils.parsers.rst.directives import images from sphinx import addnodes from sphinx.util.docfields import DocFieldTransformer @@ -22,15 +21,6 @@ from sphinx.directives.code import * from sphinx.directives.other import * -# allow units for the figure's "figwidth" -try: - images.Figure.option_spec['figwidth'] = \ - directives.length_or_percentage_or_unitless -except AttributeError: - images.figure.options['figwidth'] = \ - directives.length_or_percentage_or_unitless - - # RE to strip backslash escapes nl_escape_re = re.compile(r'\\\n') strip_backslash_re = re.compile(r'\\(.)')