Skip to content

Commit 5d7ecf9

Browse files
helgeeKristofferC
authored andcommitted
Render URL and name of Markdown links in terminal (#24803)
1 parent f383276 commit 5d7ecf9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

base/markdown/render/terminal/render.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ end
134134
terminline(io::IO, f::Footnote) = with_output_format(:bold, terminline, io, "[^$(f.id)]")
135135

136136
function terminline(io::IO, md::Link)
137-
terminline(io, md.text)
137+
terminline(io, "$(terminline(md.text)) ($(md.url))")
138138
end
139139

140140
function terminline(io::IO, code::Code)

test/markdown.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ World""" |> plain == "Hello\n\n---\n\nWorld\n"
224224

225225
# multiple whitespace is ignored
226226
@test sprint(term, md"a b") == " a b\n"
227-
@test sprint(term, md"[x](https://julialang.org)") == " x\n"
227+
@test sprint(term, md"[x](https://julialang.org)") == " x (https://julialang.org)\n"
228228
@test sprint(term, md"![x](https://julialang.org)") == " (Image: x)\n"
229229

230230
# enumeration is normalized

0 commit comments

Comments
 (0)