diff options
author | 2021-05-10 15:27:10 +0200 | |
---|---|---|
committer | 2021-05-10 15:27:10 +0200 | |
commit | 29aa72e12738fe3662d184627cc8a73ad6a24327 (patch) | |
tree | 7d68affb934dea7499b5ffb146d5d242e3e2b9cf | |
parent | Merge pull request #1542 from RohanJnr/annihilate_reddit (diff) |
Code snippet: support the two dots syntax
Lines can be highlighted in GitHub using the `L00..L42` syntax, currently not supported by the regex. This commits adds it.
-rw-r--r-- | bot/exts/info/code_snippets.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py index 06885410b..24a9ae28a 100644 --- a/bot/exts/info/code_snippets.py +++ b/bot/exts/info/code_snippets.py @@ -16,7 +16,7 @@ log = logging.getLogger(__name__) GITHUB_RE = re.compile( r'https://github\.com/(?P<repo>[a-zA-Z0-9-]+/[\w.-]+)/blob/' - r'(?P<path>[^#>]+)(\?[^#>]+)?(#L(?P<start_line>\d+)([-~:]L(?P<end_line>\d+))?)' + r'(?P<path>[^#>]+)(\?[^#>]+)?(#L(?P<start_line>\d+)(([-~:]|(\.\.))L(?P<end_line>\d+))?)' ) GITHUB_GIST_RE = re.compile( |