diff --git a/stdlib/Markdown/src/render/latex.jl b/stdlib/Markdown/src/render/latex.jl index 1e885a578d588..9a6ea41ead99c 100644 --- a/stdlib/Markdown/src/render/latex.jl +++ b/stdlib/Markdown/src/render/latex.jl @@ -101,6 +101,9 @@ function latex(io::IO, md::List) end function show(io::IO, ::MIME"text/latex", md::HorizontalRule) + latex(io, md) +end +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