diff --git a/CHANGES b/CHANGES index 11e9f9306..e52ff3ab0 100644 --- a/CHANGES +++ b/CHANGES @@ -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 ---------- diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index ca82bcdd2..95ed17c42 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -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) diff --git a/tests/root/objects.txt b/tests/root/objects.txt index 3756677e9..1fc23567a 100644 --- a/tests/root/objects.txt +++ b/tests/root/objects.txt @@ -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 diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 6d050037d..658ffdf60 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -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",