From 29aa72e12738fe3662d184627cc8a73ad6a24327 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Mon, 10 May 2021 15:27:10 +0200 Subject: 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. --- bot/exts/info/code_snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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[a-zA-Z0-9-]+/[\w.-]+)/blob/' - r'(?P[^#>]+)(\?[^#>]+)?(#L(?P\d+)([-~:]L(?P\d+))?)' + r'(?P[^#>]+)(\?[^#>]+)?(#L(?P\d+)(([-~:]|(\.\.))L(?P\d+))?)' ) GITHUB_GIST_RE = re.compile( -- cgit v1.2.3