Skip to content

Commit

Permalink
Merge pull request #97 from sopel-irc/topic-links-etc
Browse files Browse the repository at this point in the history
github: skip URL handling for links under special site sections
  • Loading branch information
dgw authored Sep 16, 2021
2 parents a5e89b9 + 8444be6 commit 58f9892
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sopel_modules/github/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
# GitHub enforces alphanumeric usernames, and allows only one punctuation character: hyphen ('-')
# Regex copied and slightly modified to meet our needs from CC0 source:
# https://github.com/shinnn/github-username-regex/blob/0794566cc10e8c5a0e562823f8f8e99fa044e5f4/module.js#L1
githubUsername = r'[A-Za-z\d](?:[A-Za-z\d]|-(?=[A-Za-z\d])){0,38}'
githubUsername = (
r'(?!(?:collections|events|sponsors|topics|trending)/)' # exclude special sections
r'[A-Za-z\d](?:[A-Za-z\d]|-(?=[A-Za-z\d])){0,38}'
)
# GitHub additionally allows dots ('.') in repo names, as well as hyphens
# not copied from anywhere, but handy to simply reuse
githubRepoSlug = r'[A-Za-z0-9\.\-]+'
Expand Down

0 comments on commit 58f9892

Please sign in to comment.