Skip to content

Commit

Permalink
prevent Docs.apropos from breaking on random stuff interpolated into …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
vtjnash committed May 30, 2017
1 parent 0e8408f commit 95677b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/docs/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ Strip all Markdown markup from x, leaving the result in plain text. Used
internally by apropos to make docstrings containing more than one markdown
element searchable.
"""
stripmd(x::ANY) = string(x) # for random objects interpolated into the docstring
stripmd(x::AbstractString) = x # base case
stripmd(x::Void) = " "
stripmd(x::Vector) = string(map(stripmd, x)...)
Expand Down
14 changes: 14 additions & 0 deletions test/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ macro macro_doctest() end

@test (@doc @macro_doctest) !== nothing

# test that random stuff interpolated into docstrings doesn't break search or other methods here
doc"""
break me:
code
$:asymbol # a symbol
$1 # a number
$string # a function
$$latex literal$$
### header!
"""
function break_me_docs end

# issue #11548

module ModuleMacroDoc
Expand Down

0 comments on commit 95677b0

Please sign in to comment.