Skip to content

Commit

Permalink
feat: add error message when detecting badly formatted code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Dec 17, 2023
1 parent d43f32e commit 025f4bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lectern/contrib/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ def messaging(ctx: Context, opts: MessagingOptions):
if token.type in ["fence", "code_block"]
]:
ctx.generate("default", Function("\n".join(code_blocks)))
elif "```" in message:
raise ErrorMessage(
"Couldn't parse code block. Make sure the triple backticks are on their own line."
)
elif opts.nothing_error:
raise ErrorMessage(opts.nothing_error)

0 comments on commit 025f4bb

Please sign in to comment.