Fix #8192: napoleon: description is disappeared by inline literals

The napoloen wrongly parses a parameter definition because regexp
matches literal string by longest match unexpectedly.
This commit is contained in:
Takeshi KOMIYA 2020-09-10 22:34:36 +09:00
parent a16cca27ef
commit 42bfed2cb3
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Bugs fixed
* #8085: i18n: Add support for having single text domain
* #8143: autodoc: AttributeError is raised when False value is passed to
autodoc_default_options
* #8192: napoleon: description is disappeared when it contains inline literals
* #8093: The highlight warning has wrong location in some builders (LaTeX,
singlehtml and so on)

View File

@ -36,7 +36,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]+:)?`.+?`)'
)