Skip to content

Commit

Permalink
Merge pull request #961 from JuliaDocs/fe/backport-0.21.4
Browse files Browse the repository at this point in the history
Backports for 0.21.4
  • Loading branch information
mortenpi authored Feb 16, 2019
2 parents 089b64a + f867ad4 commit 5312e33
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Documenter.jl changelog

## Version `v0.21.4`

* ![Bugfix][badge-bugfix] A bug in `jldoctest`-blocks that, in rare cases, resulted in
wrong output has been fixed. ([#959][github-959], [#960][github-960])

## Version `v0.21.3`

* ![Security][badge-security] The lunr.js and lodash JavaScript dependencies have been updated to their latest patch versions (from 2.3.1 to 2.3.5 and 4.17.4 to 4.17.11, respectively).
Expand Down Expand Up @@ -197,6 +202,8 @@
[github-927]: https://github.com/JuliaDocs/Documenter.jl/pull/927
[github-934]: https://github.com/JuliaDocs/Documenter.jl/pull/934
[github-946]: https://github.com/JuliaDocs/Documenter.jl/pull/946
[github-959]: https://github.com/JuliaDocs/Documenter.jl/pull/959
[github-960]: https://github.com/JuliaDocs/Documenter.jl/pull/960

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
[documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl
Expand Down
3 changes: 2 additions & 1 deletion src/DocTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ function eval_repl(block, sandbox, meta::Dict, doc::Documents.Document, page)
result.hide = REPL.ends_with_semicolon(str)
(value, success, backtrace, text) = Utilities.withoutput() do
disable_color() do
Core.eval(sandbox, Expr(:(=), :ans, ex))
Core.eval(sandbox, ex)
end
end
Core.eval(sandbox, Expr(:global, Expr(:(=), :ans, QuoteNode(value))))
result.value = value
print(result.stdout, text)
if !success
Expand Down
6 changes: 4 additions & 2 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,10 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc)
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))
Core.eval(mod, ex)
end
end
Core.eval(mod, Expr(:global, Expr(:(=), :ans, QuoteNode(value))))
result = value
print(buffer, text)
if !success
Expand Down Expand Up @@ -548,9 +549,10 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
input = droplines(str)
(value, success, backtrace, text) = Utilities.withoutput() do
cd(dirname(page.build)) do
Core.eval(mod, Expr(:(=), :ans, ex))
Core.eval(mod, ex)
end
end
Core.eval(mod, Expr(:global, Expr(:(=), :ans, QuoteNode(value))))
result = value
output = if success
hide = REPL.ends_with_semicolon(input)
Expand Down
8 changes: 8 additions & 0 deletions test/examples/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ julia> ans
1
```

```jldoctest issue959
julia> "hello"; "world"
"world"
julia> ans
"world"
```

# Issue513

```jldoctest named
Expand Down

0 comments on commit 5312e33

Please sign in to comment.