aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Muratov <[email protected]>2020-10-08 03:05:02 +0300
committerGravatar GitHub <[email protected]>2020-10-08 03:05:02 +0300
commitb55ce89f01ef4d66a8b930dcbdc061cdef3563f3 (patch)
treefc62c6b5c2faf4ef5513481ce4ff0f30be0f30ff
parentadjusted prepare_input docs and unittests (diff)
clarify prepare_input doc
Co-authored-by: Mark <[email protected]>
-rw-r--r--bot/exts/utils/snekbox.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/utils/snekbox.py b/bot/exts/utils/snekbox.py
index 295c84901..da3e07f42 100644
--- a/bot/exts/utils/snekbox.py
+++ b/bot/exts/utils/snekbox.py
@@ -77,9 +77,9 @@ class Snekbox(Cog):
"""
Extract code from the Markdown, format it, and insert it into the code template.
- If there is Markdown, ignores surrounding text.
- If there are several Markdown parts in the message, concatenates only the code blocks.
- If there is inline code but no code blocks, takes the first instance of inline code.
+ If there is any code block, ignore text outside the code block.
+ Use the first code block, but prefer a fenced code block.
+ If there are several fenced code blocks, concatenate only the fenced code blocks.
"""
if match := list(FORMATTED_CODE_REGEX.finditer(code)):
blocks = [block for block in match if block.group("block")]