aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-11-08 22:35:52 -0500
committerGravatar GitHub <[email protected]>2020-11-08 22:35:52 -0500
commit766eb5b456868337a41cc0b2496490e86c028f67 (patch)
tree7fd2bd7849657e39b332c722121249ee9304a400
parentMerge pull request #1148 from Jack92829/master (diff)
parentMerge branch 'master' into sebastiaan/bugs/codeblock-language-detection (diff)
Merge pull request #1273 from python-discord/sebastiaan/bugs/codeblock-language-detection
Detect codeblock language specifiers with special characters
-rw-r--r--bot/exts/info/codeblock/_parsing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/info/codeblock/_parsing.py b/bot/exts/info/codeblock/_parsing.py
index 65a2272c8..e35fbca22 100644
--- a/bot/exts/info/codeblock/_parsing.py
+++ b/bot/exts/info/codeblock/_parsing.py
@@ -36,7 +36,7 @@ _RE_CODE_BLOCK = re.compile(
(?P<tick>[{''.join(_TICKS)}]) # Put all ticks into a character class within a group.
\2{{2}} # Match previous group 2 more times to ensure the same char.
)
- (?P<lang>[^\W_]+\n)? # Optionally match a language specifier followed by a newline.
+ (?P<lang>[A-Za-z0-9\+\-\.]+\n)? # Optionally match a language specifier followed by a newline.
(?P<code>.+?) # Match the actual code within the block.
\1 # Match the same 3 ticks used at the start of the block.
""",