Skip to content

Commit

Permalink
Fix IndexError bug in CodeBlock converter caused by lone triple backt…
Browse files Browse the repository at this point in the history
…ick input
  • Loading branch information
Mega-JC authored Jul 27, 2024
1 parent 571a0ed commit 2477a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snakecore/commands/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 2477a26

Please sign in to comment.