diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-09-13 10:54:21 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-09-13 10:54:21 +0900 |
commit | bec30596a8f7487cad23df532bf02d1b29024dbc (patch) | |
tree | 9a0a414ea420336a66d0c12015152cb1bcc945f6 /sphinx/ext | |
parent | 5ade6b72196edd44d043888fc7847f36577d694c (diff) | |
parent | 0b44e68d4fed408453859dd9a83dc3ee68d90c7f (diff) | |
download | sphinx-git-bec30596a8f7487cad23df532bf02d1b29024dbc.tar.gz |
Merge branch '3.x' into master
Diffstat (limited to 'sphinx/ext')
-rw-r--r-- | sphinx/ext/autodoc/__init__.py | 7 | ||||
-rw-r--r-- | sphinx/ext/napoleon/docstring.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 4d01da07e..018860036 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -92,7 +92,10 @@ def members_option(arg: Any) -> Union[object, List[str]]: """Used to convert the :members: option to auto directives.""" if arg is None or arg is True: return ALL - return [x.strip() for x in arg.split(',') if x.strip()] + elif arg is False: + return None + else: + return [x.strip() for x in arg.split(',') if x.strip()] def members_set_option(arg: Any) -> Union[object, Set[str]]: @@ -170,7 +173,7 @@ def merge_members_option(options: Dict) -> None: members = options.setdefault('members', []) for key in {'private-members', 'special-members'}: - if key in options and options[key] is not ALL: + if key in options and options[key] not in (ALL, None): for member in options[key]: if member not in members: members.append(member) diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index 71ded1558..e787f46cb 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -32,7 +32,7 @@ _numpy_section_regex = re.compile(r'^[=\-`:\'"~^_*+#<>]{2,}\s*$') _single_colon_regex = re.compile(r'(?<!:):(?!:)') _xref_or_code_regex = re.compile( r'((?::(?:[a-zA-Z0-9]+[\-_+:.])*[a-zA-Z0-9]+:`.+?`)|' - r'(?:``.+``))') + r'(?:``.+?``))') _xref_regex = re.compile( r'(?:(?::(?:[a-zA-Z0-9]+[\-_+:.])*[a-zA-Z0-9]+:)?`.+?`)' ) |