Skip to content

Commit

Permalink
closes #427 by ignoring lines parsed as nothing in code blocks (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart authored Mar 25, 2020
1 parent 43bbc9b commit a0e2032
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.6.12"
version = "0.6.13"

This comment has been minimized.

Copy link
@tlienart

tlienart Mar 25, 2020

Author Owner

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
3 changes: 2 additions & 1 deletion src/eval/run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Consumes a string with Julia code, returns a vector of expression(s).
Note: this function was adapted from the `parse_input` function from Weave.jl.
"""
function parse_code(code::AS)
exs = Union{Expr,Nothing}[]
exs = Expr[]
n = sizeof(code)
pos = 1
while pos n
ex, pos = Meta.parse(code, pos)
isnothing(ex) && continue
push!(exs, ex)
end
exs
Expand Down
18 changes: 18 additions & 0 deletions test/eval/eval_fs2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,22 @@ end
<pre><code class="plaintext">hello
10</code></pre>
""")

# issue 427
h = raw"""
@def hascode = true
@def reeval = true
```julia:ex
a = 5
a *= 2
# hello
```
\show{ex}
""" |> fd2html_td
@test isapproxstr(h, """
<pre><code class="language-julia">a = 5
a *= 2
# hello</code></pre>
<pre><code class="plaintext">10</code></pre>
""")
end

1 comment on commit a0e2032

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/11537

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.13 -m "<description of version>" a0e2032f7b55e008d4bb512e875333800fd80f88
git push origin v0.6.13

Please sign in to comment.