-
Notifications
You must be signed in to change notification settings - Fork 481
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 DocTestFilters = nothing
in at-meta
#1696
Conversation
Using ```` ```@meta DocTestFilters = nothing ``` ```` as [suggested in the docs](https://juliadocs.github.io/Documenter.jl/stable/man/doctests/#Filtering-Doctests), I get ``` ERROR: LoadError: MethodError: no method matching occursin(::Nothing, ::SubString{String}) Closest candidates are: occursin(::Union{AbstractChar, AbstractString}, ::AbstractString) at strings/search.jl:622 occursin(::Regex, ::SubString; offset) at regex.jl:269 occursin(::Regex, ::AbstractString; offset) at regex.jl:264 ``` To me, it looks like this is the reason for this behavior.
src/DocTests.jl
Outdated
@@ -276,7 +276,9 @@ end | |||
function filter_doctests(strings::NTuple{2, AbstractString}, | |||
doc::Documents.Document, meta::Dict) | |||
meta_block_filters = get(meta, :DocTestFilters, []) | |||
meta_block_filters == nothing && meta_block_filters == [] | |||
if meta_block_filters === nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta_block_filters == nothing && (meta_block_filters = [])
is probably what was intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so, too. However, I thought my version was a bit more readable (which seems to be fine given this typo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the standard way of doing it as seen by the original code. It is just as easy to write meta_block_filters == []
in your version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in f726d74
Co-authored-by: Kristoffer Carlsson <[email protected]>
Using
as suggested in the docs, I get
To me, it looks like this is the reason for this behavior.