diff --git a/stdlib/Markdown/src/render/latex.jl b/stdlib/Markdown/src/render/latex.jl index 1e885a578d588..8182adba96039 100644 --- a/stdlib/Markdown/src/render/latex.jl +++ b/stdlib/Markdown/src/render/latex.jl @@ -100,7 +100,7 @@ function latex(io::IO, md::List) end end -function show(io::IO, ::MIME"text/latex", md::HorizontalRule) +function latex(io::IO, md::HorizontalRule) println(io, "\\rule{\\textwidth}{1pt}") end diff --git a/stdlib/Markdown/test/runtests.jl b/stdlib/Markdown/test/runtests.jl index e1d03fdffaffd..6c5f82278eddf 100644 --- a/stdlib/Markdown/test/runtests.jl +++ b/stdlib/Markdown/test/runtests.jl @@ -1108,3 +1108,9 @@ let @test v.content[5].loose @test !v.content[7].loose end + +# issue #29995 +let m = Markdown.parse("---"), io = IOBuffer() + show(io, "text/latex", m) + @test String(take!(io)) == "\\rule{\\textwidth}{1pt}\n" +end