Skip to content

Commit

Permalink
Fix LaTeX output for markdown tables. (#25025)
Browse files Browse the repository at this point in the history
The `\hline` was printed to `STDOUT`.

Also added a test.
  • Loading branch information
tpapp authored and fredrikekre committed Dec 11, 2017
1 parent cffc6ac commit 224f1e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/markdown/GitHub/table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function latex(io::IO, md::Table)
end
println(io, " \\\\")
if i == 1
println("\\hline")
println(io, "\\hline")
end
end
end
Expand Down
8 changes: 8 additions & 0 deletions test/markdown.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ Some **bolded**
- list2
"""
@test latex(book) == "\\section{Title}\nSome discussion\n\n\\begin{quote}\nA quote\n\n\\end{quote}\n\\subsection{Section \\emph{important}}\nSome \\textbf{bolded}\n\n\\begin{itemize}\n\\item list1\n\n\n\\item list2\n\n\\end{itemize}\n"
table = md"""
a | b
---|---
1 | 2
"""
@test latex(table) ==
"\\begin{tabular}\n{r | r}\na & b \\\\\n\\hline\n1 & 2 \\\\\n\\end{tabular}\n"

# mime output
let out =
"""
Expand Down

0 comments on commit 224f1e9

Please sign in to comment.