Description
While working on #1724, we discovered that the githubinfo passive listener incorrectly triggers on GitHub issue references inside inline code blocks, provided the code block does not start at the beginning of a line.
Steps to Reproduce
Send the message "I am looking at python-discord/bot#123 right now"
Expected Behaviour
Should not trigger the bot's passive listener.
Actual Behaviour
Incorrectly triggers the bot to fetch the issue.

Known Impacted Platforms
Possible Solutions
I think the issue stems from:
|
CODE_BLOCK_RE = re.compile( |
|
r"^`([^`\n]+)`" # Inline codeblock |
|
r"|```(.+?)```", # Multiline codeblock |
|
re.DOTALL | re.MULTILINE |
|
) |
Where the
CODE_BLOCK_RE regex anchors the match exclusively to the start of the string/line.
A possible fix would be to remove
^ from line 37:
CODE_BLOCK_RE = re.compile(
r"`([^`\n]+)`" # Removed the ^
r"|```(.+?)```",
re.DOTALL | re.MULTILINE
)
Would you like to implement a fix?
We can fix this when we implement #1724
Description
While working on #1724, we discovered that the
githubinfopassive listener incorrectly triggers on GitHub issue references inside inline code blocks, provided the code block does not start at the beginning of a line.Steps to Reproduce
Send the message "I am looking at
python-discord/bot#123right now"Expected Behaviour
Should not trigger the bot's passive listener.
Actual Behaviour
Incorrectly triggers the bot to fetch the issue.

Known Impacted Platforms
Possible Solutions
I think the issue stems from:
sir-lancebot/bot/exts/utilities/githubinfo.py
Lines 36 to 40 in 3d83810
Where the
CODE_BLOCK_REregex anchors the match exclusively to the start of the string/line.A possible fix would be to remove
^from line 37:Would you like to implement a fix?
We can fix this when we implement #1724