Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/Markdown/src/Julia/interp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ toexpr(x) = x
toexpr(xs::Union{Vector{Any},Vector{Vector{Any}}}) =
Expr(:call, GlobalRef(Base,:getindex), Any, mapany(toexpr, xs)...)

for T in Any[MD, Paragraph, Header, Link, Bold, Italic]
for T in Any[MD, Paragraph, Header, Link, Bold, Italic, Footnote, Admonition]
@eval function toexpr(md::$T)
Expr(:call, typeof(md), $(map(x->:(toexpr(md.$x)), fieldnames(Base.unwrap_unionall(T)))...))
end
Expand Down
24 changes: 24 additions & 0 deletions stdlib/Markdown/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,30 @@ sum_ref = md"Behaves like $(ref(sum))"
@test plain(sum_ref) == "Behaves like sum (see Julia docs)\n"
@test html(sum_ref) == "<p>Behaves like sum &#40;see Julia docs&#41;</p>\n"

# JuliaLang/julia#59783
let x = 1,
result = md"""
$x

[^1]: $x

!!! note
$x
""",
expected = """
1

[^1]: 1

!!! note



1
"""
@test plain(result) == expected
end

show(io::IO, m::MIME"text/html", r::Reference) =
Markdown.withtag(io, :a, :href=>"test") do
Markdown.htmlesc(io, Markdown.plaininline(r))
Expand Down