|
151 | 151 | # The :exc:`Exception`s |
152 | 152 | # instead of: |
153 | 153 | # The :exc:`Exceptions`\ s |
154 | | -role_body = r"([^`]|\s`+|\\`)+" |
155 | 154 | role_missing_surrogate_escape = re.compile( |
156 | | - rf"{role_head}`{role_body}(?<![\\\s`])`(?!{end_string_suffix})" |
| 155 | + rf"{role_head}`[^`]+?(?<![\\\s`])`(?!{end_string_suffix})" |
157 | 156 | ) |
158 | 157 |
|
159 | 158 | # TODO: cover more cases |
@@ -201,7 +200,7 @@ def is_in_a_table(error, line): |
201 | 200 | return "|" in line[: error.start()] and "|" in line[error.end() :] |
202 | 201 |
|
203 | 202 |
|
204 | | -role_missing_closing_backtick = re.compile(rf"({role_head}`{role_body})[^`]*$") |
| 203 | +role_missing_closing_backtick = re.compile(rf"({role_head}`[^`]+?)[^`]*$") |
205 | 204 |
|
206 | 205 |
|
207 | 206 | def check_paragraph(paragraph_lno, paragraph): |
@@ -231,6 +230,7 @@ def check_suspicious_constructs_in_paragraphs(file, lines): |
231 | 230 | yield from check_paragraph(paragraph_lno, "".join(paragraph)) |
232 | 231 |
|
233 | 232 |
|
| 233 | +role_body = r"([^`]|\s`+|\\`)+" |
234 | 234 | backtick_in_front_of_role = re.compile(rf"(^|\s)`:{simplename}:`{role_body}`") |
235 | 235 |
|
236 | 236 |
|
@@ -370,25 +370,6 @@ def type_of_explicit_markup(line): |
370 | 370 | return "comment" |
371 | 371 |
|
372 | 372 |
|
373 | | -glued_inline_literals = re.compile( |
374 | | - rf"{start_string_prefix}(``[^`]+?(?!{start_string_prefix})``)(?!{end_string_suffix})" |
375 | | -) |
376 | | - |
377 | | - |
378 | | -@checker(".rst", severity=2) |
379 | | -def check_missing_surrogate_space_on_plural(file, lines): |
380 | | - r"""Check for missing 'backslash-space' between a code sample a letter. |
381 | | -
|
382 | | - Good: ``Point``\ s |
383 | | - Bad: ``Point``s |
384 | | - """ |
385 | | - for lno, line in enumerate(hide_non_rst_blocks(lines)): |
386 | | - match = glued_inline_literals.search(line) |
387 | | - if match and match.start() != 0: |
388 | | - literal = match.group(2) |
389 | | - yield lno + 1, f"Missing backslash-space between literal {literal} (column {match.start()!r})." |
390 | | - |
391 | | - |
392 | 373 | triple_backticks = re.compile( |
393 | 374 | rf"(?:{start_string_prefix})```[^`]+?(?<!{start_string_prefix})```(?:{end_string_suffix})" |
394 | 375 | ) |
|
0 commit comments