Skip to content

Commit f5c972c

Browse files
jmertKristofferC
authored andcommitted
Add passthrough for non-Markdown docs (#36091)
(cherry picked from commit 063525f)
1 parent 593033d commit f5c972c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

stdlib/REPL/src/docview.jl

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ function Markdown.term(io::IO, msg::Message, columns)
108108
printstyled(io, msg.msg; msg.fmt...)
109109
end
110110

111+
trimdocs(doc, brief::Bool) = doc
112+
111113
function trimdocs(md::Markdown.MD, brief::Bool)
112114
brief || return md
113115
md, trimmed = _trimdocs(md, brief)

stdlib/REPL/test/repl.jl

+18
Original file line numberDiff line numberDiff line change
@@ -1093,13 +1093,31 @@ Short docs
10931093
Long docs
10941094
"""
10951095
f() = nothing
1096+
@doc text"""
1097+
f_plain()
1098+
1099+
Plain text docs
1100+
"""
1101+
f_plain() = nothing
1102+
@doc html"""
1103+
<h1><code>f_html()</code></h1>
1104+
<p>HTML docs.</p>
1105+
"""
1106+
f_html() = nothing
10961107
end # module BriefExtended
1108+
10971109
buf = IOBuffer()
10981110
md = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f"))
10991111
@test length(md.content) == 2 && isa(md.content[2], REPL.Message)
11001112
buf = IOBuffer()
11011113
md = Base.eval(REPL._helpmode(buf, "?$(@__MODULE__).BriefExtended.f"))
11021114
@test length(md.content) == 1 && length(md.content[1].content[1].content) == 4
1115+
buf = IOBuffer()
1116+
txt = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_plain"))
1117+
@test !isempty(sprint(show, txt))
1118+
buf = IOBuffer()
1119+
html = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_html"))
1120+
@test !isempty(sprint(show, html))
11031121

11041122
# PR #27562
11051123
fake_repl() do stdin_write, stdout_read, repl

0 commit comments

Comments
 (0)