Skip to content
Snippets Groups Projects
Commit b22d19e4 authored by Campbell Barton's avatar Campbell Barton
Browse files

check_spelling: accept opening brackets before quoted text

This allows (`interpret as code`) to be ignored as if there
were no surrounding brackets.
parent cc857792
Branches
Tags
No related merge requests found
...@@ -161,7 +161,7 @@ re_ignore = re.compile( ...@@ -161,7 +161,7 @@ re_ignore = re.compile(
r'(' r'('
# URL. # URL.
r'(https?|ftp)://\S+|' r'\b(https?|ftp)://\S+|'
# Email address: <me@email.com> # Email address: <me@email.com>
# <someone@foo.bar-baz.com> # <someone@foo.bar-baz.com>
r"<\w+@[\w\.\-]+>|" r"<\w+@[\w\.\-]+>|"
...@@ -190,8 +190,10 @@ re_ignore = re.compile( ...@@ -190,8 +190,10 @@ re_ignore = re.compile(
r'\w+\.\w+\S*|' r'\w+\.\w+\S*|'
# Single and back-tick quotes (often used to reference code). # Single and back-tick quotes (often used to reference code).
r"\s\`[^\n`]+\`|" # Allow white-space or any bracket prefix, e.g:
r"\s'[^\n']+'" # (`expr a+b`)
r"[\s\(\[\{]\`[^\n`]+\`|"
r"[\s\(\[\{]'[^\n']+'"
r')', r')',
re.MULTILINE | re.DOTALL, re.MULTILINE | re.DOTALL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment