Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in case of empty # output #1510

Merged
merged 6 commits into from
Feb 3, 2021

Conversation

knuesel
Copy link
Contributor

@knuesel knuesel commented Jan 26, 2021

Without this PR, a doctest such as

```jldoctest
nothing
# output
```

results in a BoundsError exception:

ERROR: LoadError: BoundsError: attempt to access 1-element Array{SubString{String},1} at index [2]
Stacktrace:
 [1] getindex at ./array.jl:809 [inlined]
 [2] indexed_iterate at ./tuple.jl:82 [inlined]
 [3] eval_script(::Documenter.DocTests.MutableMD2CodeBlock, ::Module, ::Dict{Symbol,Any}, ::Documenter.Documents.Document, ::String) at /home/j/.julia/packages/Documenter/b3ri2/src/DocTests.jl:242
...

@fredrikekre
Copy link
Member

fredrikekre commented Jan 26, 2021

```jldoctest
nothing
# output

```

Still works I believe, but no reason to not support it without the extra empty line.

@knuesel
Copy link
Contributor Author

knuesel commented Jan 26, 2021

Yes with an empty line it works already (but the doc says that "the amount of whitespace appearing above and below the # output line is not significant").

src/DocTests.jl Outdated Show resolved Hide resolved
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
src/DocTests.jl Outdated Show resolved Hide resolved
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
@mortenpi mortenpi added this to the 0.26.2 milestone Feb 2, 2021
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants