mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 17:02:12 -05:00
Closes #1198: Allow "image" for the "figwidth" option of the :rst:dir:figure directive as documented by docutils.
This commit is contained in:
1 parent
12b3b49f22
commit
531d70989f
2 files changed
+3
-10
No files matched your search
@@ -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'\\(.)')
|
||||
|
||||
Reference in new issue
Block a user