mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-14 17:32:12 -05:00
Fix #6436: napoleon: "Unknown target name" error
This commit is contained in:
1 parent
f0b1cbb734
commit
c4dfc7402e
3 files changed
+7
-2
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user