diff options
author | 2020-11-08 22:35:52 -0500 | |
---|---|---|
committer | 2020-11-08 22:35:52 -0500 | |
commit | 766eb5b456868337a41cc0b2496490e86c028f67 (patch) | |
tree | 7fd2bd7849657e39b332c722121249ee9304a400 | |
parent | Merge pull request #1148 from Jack92829/master (diff) | |
parent | Merge 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.py | 2 |
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. """, |