mirror of https://github.com/mpastell/Weave.jl
fix chunk options regression
parent
b1de7efede
commit
6b6f82bed4
|
@ -5,7 +5,7 @@ function parse_markdown(document_body; is_pandoc = false)
|
||||||
r"^<<(?<options>.*?)>>=\s*$",
|
r"^<<(?<options>.*?)>>=\s*$",
|
||||||
r"^@\s*$"
|
r"^@\s*$"
|
||||||
else
|
else
|
||||||
r"^[`~]{3}(\{?)julia\s*([;,]?)\s*(?<options>.*?)(\}|\s*)$",
|
r"^[`~]{3}(\{?)julia\s*([;,\{]?)\s*(?<options>.*?)(\}|\s*)$",
|
||||||
r"^[`~]{3}\s*$"
|
r"^[`~]{3}\s*$"
|
||||||
end
|
end
|
||||||
return header, parse_markdown_body(document_body, code_start, code_end, offset)
|
return header, parse_markdown_body(document_body, code_start, code_end, offset)
|
||||||
|
|
|
@ -72,6 +72,10 @@ let opts = get_options("```julia, opt1 = 1, opt2 = \"2\"\n```")
|
||||||
@test (:opt1 => 1) in opts
|
@test (:opt1 => 1) in opts
|
||||||
@test (:opt2 => "2") in opts
|
@test (:opt2 => "2") in opts
|
||||||
end
|
end
|
||||||
|
let opts = get_options("```julia{opt1 = 1, opt2 = \"2\"}\n```")
|
||||||
|
@test (:opt1 => 1) in opts
|
||||||
|
@test (:opt2 => "2") in opts
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
doc = mock_run("""
|
doc = mock_run("""
|
||||||
```julia
|
```julia
|
||||||
using DataFrames
|
using DataFrames
|
||||||
DataFrame(rand(10,3))
|
DataFrame(a=rand(10))
|
||||||
```
|
```
|
||||||
"""; doctype = "md2html")
|
"""; doctype = "md2html")
|
||||||
@test isdefined(doc.chunks[1], :rich_output)
|
@test isdefined(doc.chunks[1], :rich_output)
|
||||||
|
@ -17,7 +17,7 @@ n = 100000
|
||||||
doc = mock_run("""
|
doc = mock_run("""
|
||||||
```julia
|
```julia
|
||||||
using DataFrames
|
using DataFrames
|
||||||
DataFrame(rand($n,3))
|
DataFrame(a=rand($n))
|
||||||
```
|
```
|
||||||
"""; doctype = "md2html")
|
"""; doctype = "md2html")
|
||||||
@test isdefined(doc.chunks[1], :rich_output)
|
@test isdefined(doc.chunks[1], :rich_output)
|
||||||
|
|
Loading…
Reference in New Issue