mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #6436: napoleon: "Unknown target name" error
This commit is contained in:
parent
f0b1cbb734
commit
c4dfc7402e
2
CHANGES
2
CHANGES
@ -20,6 +20,8 @@ Bugs fixed
|
||||
immediately preceding section title by pagebreak
|
||||
* #6448: autodoc: crashed when autodocumenting classes with ``__slots__ = None``
|
||||
* #6452: autosummary: crashed when generating document of properties
|
||||
* #6436: napoleon: "Unknown target name" error if variable name ends with
|
||||
underscore
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -328,6 +328,9 @@ class GoogleDocstring:
|
||||
|
||||
def _escape_args_and_kwargs(self, name):
|
||||
# type: (str) -> str
|
||||
if name.endswith('_'):
|
||||
name = name[:-1] + r'\_'
|
||||
|
||||
if name[:2] == '**':
|
||||
return r'\*\*' + name[2:]
|
||||
elif name[:1] == '*':
|
||||
|
@ -1351,8 +1351,8 @@ arg_ : type
|
||||
"""
|
||||
|
||||
expected = """
|
||||
:ivar arg_: some description
|
||||
:vartype arg_: type
|
||||
:ivar arg\\_: some description
|
||||
:vartype arg\\_: type
|
||||
"""
|
||||
|
||||
config = Config(napoleon_use_ivar=True)
|
||||
|
Loading…
Reference in New Issue
Block a user