Fix #646: `option` directive support . character as a part of options

This commit is contained in:
Takeshi KOMIYA 2016-08-31 00:02:17 +09:00
parent 8e0a998592
commit c7f299b86f
4 changed files with 11 additions and 2 deletions

View File

@ -110,6 +110,7 @@ Features added
* #1210: ``eqref`` role now supports cross reference
* #2892: Added ``-a`` (``--append-syspath``) option to ``sphinx-apidoc``
* #1604: epub3 builder: Obey font-related CSS when viewing in iBooks.
* #646: ``option`` directive support '.' character as a part of options
Bugs fixed
----------

View File

@ -28,7 +28,7 @@ from sphinx.util.compat import Directive
# RE for option descriptions
option_desc_re = re.compile(r'((?:/|--|-|\+)?[-?@#_a-zA-Z0-9]+)(=?\s*.*)')
option_desc_re = re.compile(r'((?:/|--|-|\+)?[-\.?@#_a-zA-Z0-9]+)(=?\s*.*)')
# RE for grammar tokens
token_re = re.compile('`(\w+)`', re.U)

View File

@ -172,9 +172,13 @@ Others
.. option:: +p
.. option:: --plugin.option
.. option:: create-auth-token
.. option:: arg
Link to :option:`perl +p` and :option:`arg`
Link to :option:`perl +p`, :option:`--plugin.option`, :option:`create-auth-token` and :option:`arg`
.. program:: hg

View File

@ -244,6 +244,10 @@ HTML_XPATH = {
'perl'),
(".//a[@class='reference internal'][@href='#cmdoption-perl-arg-+p']/code/span",
'\+p'),
(".//a[@class='reference internal'][@href='#cmdoption-perl--plugin.option']/code/span",
'--plugin.option'),
(".//a[@class='reference internal'][@href='#cmdoption-perl-arg-create-auth-token']/code/span",
'create-auth-token'),
(".//a[@class='reference internal'][@href='#cmdoption-perl-arg-arg']/code/span",
'arg'),
(".//a[@class='reference internal'][@href='#cmdoption-hg-arg-commit']/code/span",