Skip to content

Commit

Permalink
Fix crash in case of empty # output (#1510)
Browse files Browse the repository at this point in the history
(cherry picked from commit dffba5f)
  • Loading branch information
knuesel authored and mortenpi committed Feb 9, 2021
1 parent d8293ca commit d352a01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Version `v0.26.2`

* ![Bugfix][badge-bugfix] Script-type doctests that have an empty output section no longer crash Documenter. ([#1510][github-1510])

* ![Bugfix][badge-bugfix] When checking for authentication keys when deploying, Documenter now more appropriately checks if the environment variables are non-empty, rather than just whether they are defined. ([#1511][github-1511])

## Version `v0.26.1`
Expand Down Expand Up @@ -726,6 +728,7 @@
[github-1491]: https://github.com/JuliaDocs/Documenter.jl/pull/1491
[github-1493]: https://github.com/JuliaDocs/Documenter.jl/pull/1493
[github-1497]: https://github.com/JuliaDocs/Documenter.jl/pull/1497
[github-1510]: https://github.com/JuliaDocs/Documenter.jl/pull/1510
[github-1511]: https://github.com/JuliaDocs/Documenter.jl/pull/1511

[julia-38079]: https://github.com/JuliaLang/julia/issues/38079
Expand Down
2 changes: 1 addition & 1 deletion src/DocTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function eval_script(block, sandbox, meta::Dict, doc::Documents.Document, page)
#
#
# to mark `input`/`output` separation.
input, output = split(block.code, "# output\n", limit = 2)
input, output = split(block.code, r"^# output$"m, limit = 2)
input = rstrip(input, '\n')
output = lstrip(output, '\n')
result = Result(block, input, output, meta[:CurrentFile])
Expand Down
9 changes: 8 additions & 1 deletion test/doctests/src/working.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@ Comments at the start:
# .. should be ignored.
julia> 2 + 2
4
```
```

Empty output:

```jldoctest
nothing
# output
```

0 comments on commit d352a01

Please sign in to comment.