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
  • Loading branch information
fredrikekre authored and tkf committed Nov 21, 2018
1 parent 1b884e7 commit 4b83638
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 4b83638

Please sign in to comment.