Skip to content

Commit

Permalink
fix #886: skip keyword special casing in code-block parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jan 24, 2019
1 parent 8d17f68 commit fcfcf0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* ![Bugfix][badge-bugfix] `@repl` blocks now work correctly together with quoted
expressions. ([#923][github-923], [#926][github-926])

* ![Bugfix][badge-bugfix] `@example`, `@repl` and `@eval` blocks now handle keywords,
e.g. `try`/`catch`, correctly. ([#886][github-886], [#927][github-927])

## Version `v0.21.0`

* ![Deprecation][badge-deprecation] ![Enhancement][badge-enhancement] The symbol values to the `format` argument of `makedocs` (`:html`, `:markdown`, `:latex`) have been deprecated in favor of the `Documenter.HTML`, `Markdown` and `LaTeX`
Expand Down Expand Up @@ -176,12 +179,15 @@
[github-876]: https://github.com/JuliaDocs/Documenter.jl/pull/876
[github-879]: https://github.com/JuliaDocs/Documenter.jl/pull/879
[github-885]: https://github.com/JuliaDocs/Documenter.jl/pull/885
[github-886]: https://github.com/JuliaDocs/Documenter.jl/pull/886
[github-891]: https://github.com/JuliaDocs/Documenter.jl/pull/891
[github-898]: https://github.com/JuliaDocs/Documenter.jl/pull/898
[github-905]: https://github.com/JuliaDocs/Documenter.jl/pull/905
[github-907]: https://github.com/JuliaDocs/Documenter.jl/pull/907
[github-917]: https://github.com/JuliaDocs/Documenter.jl/pull/917
[github-923]: https://github.com/JuliaDocs/Documenter.jl/pull/923
[github-926]: https://github.com/JuliaDocs/Documenter.jl/pull/926
[github-927]: https://github.com/JuliaDocs/Documenter.jl/pull/927

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
[documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl
Expand Down
6 changes: 3 additions & 3 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function Selectors.runner(::Type{EvalBlocks}, x, page, doc)
sandbox = Module(:EvalBlockSandbox)
cd(dirname(page.build)) do
result = nothing
for (ex, str) in Utilities.parseblock(x.code, doc, page)
for (ex, str) in Utilities.parseblock(x.code, doc, page; keywords = false)
try
result = Core.eval(sandbox, ex)
catch err
Expand Down Expand Up @@ -484,7 +484,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc)
else
code = x.code
end
for (ex, str) in Utilities.parseblock(code, doc, page)
for (ex, str) in Utilities.parseblock(code, doc, page; keywords = false)
(value, success, backtrace, text) = Utilities.withoutput() do
cd(dirname(page.build)) do
Core.eval(mod, Expr(:(=), :ans, ex))
Expand Down Expand Up @@ -542,7 +542,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
mod = get!(() -> get_new_sandbox(sym), page.globals.meta, sym)
code = split(x.code, '\n'; limit = 2)[end]
result, out = nothing, IOBuffer()
for (ex, str) in Utilities.parseblock(x.code, doc, page)
for (ex, str) in Utilities.parseblock(x.code, doc, page; keywords = false)
buffer = IOBuffer()
input = droplines(str)
(value, success, backtrace, text) = Utilities.withoutput() do
Expand Down

0 comments on commit fcfcf0f

Please sign in to comment.