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 DocTestFilters = nothing in at-meta #1696

Merged
merged 4 commits into from
Sep 15, 2021
Merged

Conversation

ranocha
Copy link
Contributor

@ranocha ranocha commented Sep 15, 2021

Using

```@meta
DocTestFilters = nothing
```

as suggested in the docs, 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.

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
Copy link
Member

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

Copy link
Contributor Author

@ranocha ranocha Sep 15, 2021

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)

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in f726d74

src/DocTests.jl Outdated Show resolved Hide resolved
@fredrikekre fredrikekre merged commit 50246d0 into JuliaDocs:master Sep 15, 2021
benlorenz added a commit to benlorenz/Documenter.jl that referenced this pull request Sep 19, 2023
mortenpi pushed a commit that referenced this pull request Sep 28, 2023
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.

4 participants