diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index 1b85278cccc03..a1391568ecc82 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -108,6 +108,8 @@ function Markdown.term(io::IO, msg::Message, columns) printstyled(io, msg.msg; msg.fmt...) end +trimdocs(doc, brief::Bool) = doc + function trimdocs(md::Markdown.MD, brief::Bool) brief || return md md, trimmed = _trimdocs(md, brief) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index 57b0be33c823f..4bbbeb509854a 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -1093,13 +1093,31 @@ Short docs Long docs """ f() = nothing +@doc text""" + f_plain() + +Plain text docs +""" +f_plain() = nothing +@doc html""" +
f_html()
HTML docs.
+""" +f_html() = nothing end # module BriefExtended + buf = IOBuffer() md = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f")) @test length(md.content) == 2 && isa(md.content[2], REPL.Message) buf = IOBuffer() md = Base.eval(REPL._helpmode(buf, "?$(@__MODULE__).BriefExtended.f")) @test length(md.content) == 1 && length(md.content[1].content[1].content) == 4 +buf = IOBuffer() +txt = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_plain")) +@test !isempty(sprint(show, txt)) +buf = IOBuffer() +html = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_html")) +@test !isempty(sprint(show, html)) # PR #27562 fake_repl() do stdin_write, stdout_read, repl