Skip to content

Commit 2f5e5b3

Browse files
committed
Define text/latex printing of HorizontalRule with the latex function, fix #29995.
1 parent 9eda36f commit 2f5e5b3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

stdlib/Markdown/src/render/latex.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ function latex(io::IO, md::List)
101101
end
102102

103103
function show(io::IO, ::MIME"text/latex", md::HorizontalRule)
104+
latex(io, md)
105+
end
106+
function latex(io::IO, md::HorizontalRule)
104107
println(io, "\\rule{\\textwidth}{1pt}")
105108
end
106109

stdlib/Markdown/test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,3 +1108,9 @@ let
11081108
@test v.content[5].loose
11091109
@test !v.content[7].loose
11101110
end
1111+
1112+
# issue #29995
1113+
let m = Markdown.parse("---"), io = IOBuffer()
1114+
show(io, "text/latex", m)
1115+
@test String(take!(io)) == "\\rule{\\textwidth}{1pt}\n"
1116+
end

0 commit comments

Comments
 (0)