Skip to content

Commit

Permalink
In case the codeblock regex fails to match, print the codeblock so us…
Browse files Browse the repository at this point in the history
…ers know where to look for the problem. (#1066)
  • Loading branch information
chriselrod authored Nov 28, 2023
1 parent 1869746 commit 8c04325
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eval/codeblock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function parse_fenced_block(ss::SubString, scut=false; shortcut=scut, # scut for
reg = startswith(ss, "`````") ? CODE_5_PAT :
startswith(ss, "````") ? CODE_4_PAT : CODE_3_PAT
m = match(reg, ss)
if m === nothing
throw(ArgumentError("Could not match codeblock:\n$ss"))
end
lang = m.captures[1]
rpath = m.captures[2]
code = strip(m.captures[3])
Expand Down

0 comments on commit 8c04325

Please sign in to comment.