Skip to content

Commit

Permalink
Handle non-existing files in find_block_in_file (#1002)
Browse files Browse the repository at this point in the history
Currently find_block_in_file will throw an error if the file does not
exist, which can happen if a Base docstring is being included.
  • Loading branch information
mortenpi authored Apr 29, 2019
1 parent 50dbc78 commit 45fb128
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Documenter.jl changelog

## Version `v0.22.4`

* ![Bugfix][badge-bugfix] Documenter no longer crashes if the build includes doctests from docstrings that are defined in files that do not exist on the file system (e.g. if a Julia Base docstring is included when running a non-source Julia build). ([#1002][github-1002])

## Version `v0.22.3`

* ![Bugfix][badge-bugfix] Fixed filepaths for images included in the .tex file for PDF output on Windows. ([#999][github-999])
Expand Down Expand Up @@ -299,6 +303,7 @@
[github-995]: https://github.com/JuliaDocs/Documenter.jl/pull/995
[github-996]: https://github.com/JuliaDocs/Documenter.jl/pull/996
[github-999]: https://github.com/JuliaDocs/Documenter.jl/pull/999
[github-1002]: https://github.com/JuliaDocs/Documenter.jl/pull/1002

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
[documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ regex_escape(str) = sprint(escape_string, str, "\\^\$.|?*+()[{")
function find_block_in_file(code, file)
source_file = Base.find_source_file(file)
source_file === nothing && return nothing
isfile(source_file) || return nothing
content = read(source_file, String)
content = replace(content, "\r\n" => "\n")
# make a regex of the code that matches leading whitespace
Expand Down

0 comments on commit 45fb128

Please sign in to comment.