mirror of https://github.com/mpastell/Weave.jl
Exception handling for invalid chunk options
parent
1c2ae8b33b
commit
13458bf001
|
@ -110,6 +110,7 @@ function run(parsed)
|
|||
end
|
||||
|
||||
merge!(chunk, options)
|
||||
delete!(chunk, "options")
|
||||
|
||||
|
||||
chunk["evaluate"] || (chunk["result"] = ""; continue) #Do nothing if eval is false
|
||||
|
|
|
@ -24,7 +24,12 @@ function read_noweb(document)
|
|||
if strip(optionstring)==""
|
||||
options = Dict()
|
||||
else
|
||||
options = eval(parse("{" * optionstring * "}"))
|
||||
try
|
||||
options = eval(parse("{" * optionstring * "}"))
|
||||
catch
|
||||
options = Dict()
|
||||
warn(string("Invalid format for chunk options line: ", lineno))
|
||||
end
|
||||
end
|
||||
haskey(options, "label") && (options["name"] = options["label"])
|
||||
haskey(options, "name") || (options["name"] = nothing)
|
||||
|
@ -47,7 +52,7 @@ function read_noweb(document)
|
|||
continue
|
||||
end
|
||||
|
||||
content *= "\n" * line
|
||||
content *= "\n" * line
|
||||
end
|
||||
|
||||
#Remember the last chunk
|
||||
|
|
Loading…
Reference in New Issue