Don't treat text as option if it matches -[0-9]

-[0-9] is valid option, but we don't use them so far and don't want to
 mark integer -1 as option.
This commit is contained in:
Tatsuhiro Tsujikawa 2019-01-18 21:18:18 +09:00
parent ea69c84b33
commit bd93d90a89
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ def format_text(text):
else: else:
text = re.sub(r'\*', r'\*', text) text = re.sub(r'\*', r'\*', text)
# markup option reference # markup option reference
text = re.sub(r'(^|\s)(-[a-zA-Z0-9]|--[a-zA-Z0-9-]+)', text = re.sub(r'(^|\s)(-[a-zA-Z]|--[a-zA-Z0-9-]+)',
r'\1:option:`\2`', text) r'\1:option:`\2`', text)
# sphinx does not like markup like ':option:`-f`='. We need # sphinx does not like markup like ':option:`-f`='. We need
# backslash between ` and =. # backslash between ` and =.