Skip to content

Commit

Permalink
Define text/latex printing of HorizontalRule with the latex function, f…
Browse files Browse the repository at this point in the history
…ix #29995.

(cherry picked from commit 2f5e5b3)
  • Loading branch information
fredrikekre authored and KristofferC committed Nov 19, 2018
1 parent 49b839f commit 29f13f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stdlib/Markdown/src/render/latex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions stdlib/Markdown/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 29f13f3

Please sign in to comment.