From 2477a26fc06be88aa3da07e89e3f37e83282df8a Mon Sep 17 00:00:00 2001 From: "Sunny J. C." <65417594+Mega-JC@users.noreply.github.com> Date: Sat, 27 Jul 2024 22:13:21 +0200 Subject: [PATCH] Fix IndexError bug in CodeBlock converter caused by lone triple backtick input --- snakecore/commands/converters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snakecore/commands/converters.py b/snakecore/commands/converters.py index 694b836..69398f9 100644 --- a/snakecore/commands/converters.py +++ b/snakecore/commands/converters.py @@ -486,7 +486,7 @@ def from_markdown(cls, markdown: str) -> Self: "argument 'markdown' must be of type 'str' containing a markdown code block, " f"not {markdown.__class__.__name__}" ) - elif not (markdown.startswith("`") and markdown.endswith("`")): + elif markdown == "```" or not (markdown.startswith("`") and markdown.endswith("`")): raise ValueError( "argument 'markdown' does not contain a markdown code block" )