From b55ce89f01ef4d66a8b930dcbdc061cdef3563f3 Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Thu, 8 Oct 2020 03:05:02 +0300 Subject: clarify prepare_input doc Co-authored-by: Mark --- bot/exts/utils/snekbox.py | 6 +++--- 1 file 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")] -- cgit v1.2.3