summaryrefslogtreecommitdiff
path: root/utils/doclinter.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-07-07 02:09:50 +0900
committerGitHub <noreply@github.com>2021-07-07 02:09:50 +0900
commit5e5bca98f752cb61c36afc7955183e79a6095cf2 (patch)
tree66fc9448a4bbab736469fdad514dfa970787d495 /utils/doclinter.py
parent988a79de65737e403cd27721ce091760cf62b97f (diff)
parentf0fef96906d80d89e290a780767a92ba85977733 (diff)
downloadsphinx-git-5e5bca98f752cb61c36afc7955183e79a6095cf2.tar.gz
Merge branch '4.x' into 6525_linkcheck_warn_redirects
Diffstat (limited to 'utils/doclinter.py')
-rw-r--r--utils/doclinter.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/doclinter.py b/utils/doclinter.py
index f8df20bf7..48e40e90a 100644
--- a/utils/doclinter.py
+++ b/utils/doclinter.py
@@ -41,7 +41,7 @@ def lint(path: str) -> int:
pass
else:
spaces = LEADING_SPACES.match(line).group(1)
- if len(spaces) < code_block_depth:
+ if len(spaces) <= code_block_depth:
in_code_block = False
elif LONG_INTERPRETED_TEXT.match(line):
pass
@@ -49,6 +49,9 @@ def lint(path: str) -> int:
if re.match(r'^\s*\.\. ', line):
# ignore directives and hyperlink targets
pass
+ elif re.match(r'^\s*__ ', line):
+ # ignore anonymous hyperlink targets
+ pass
elif re.match(r'^\s*``[^`]+``$', line):
# ignore a very long literal string
pass