mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1198: Allow "image" for the "figwidth" option of the :rst:dir:figure
directive as documented by docutils.
This commit is contained in:
parent
12b3b49f22
commit
531d70989f
3
CHANGES
3
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
|
||||
-------------
|
||||
|
||||
|
@ -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'\\(.)')
|
||||
|
Loading…
Reference in New Issue
Block a user