git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: better handling of line breaks in simple tables.
2bd5d0cJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX/Table.hs+1−3
@@ -219,9 +219,7 @@ footRows (Ann.TableFoot _attr rows) = map headerRowCells rows
219-- we need to go to some lengths to get line breaks working:
219-- we need to go to some lengths to get line breaks working:
220-- as LineBreak bs = \vtop{\hbox{\strut as}\hbox{\strut bs}}.
220-- as LineBreak bs = \vtop{\hbox{\strut as}\hbox{\strut bs}}.
221fixLineBreaks :: Block -> Block
221fixLineBreaks :: Block -> Block
222−fixLineBreaks (Para ils) = Para $ fixLineBreaks' ils
222+fixLineBreaks = walk fixLineBreaks'
223−fixLineBreaks (Plain ils) = Plain $ fixLineBreaks' ils
224−fixLineBreaks x = x
225
223
226fixLineBreaks' :: [Inline] -> [Inline]
224fixLineBreaks' :: [Inline] -> [Inline]
227fixLineBreaks' ils = case splitBy (== LineBreak) ils of
225fixLineBreaks' ils = case splitBy (== LineBreak) ils of
test/command/7272.mdnew file+24
@@ -0,0 +1,24 @@
1+```
2+% pandoc -t latex -f html
3+<table>
4+ <tbody>
5+ <tr>
6+ <td>
7+ <span>
8+ text
9+ <br />
10+ text2
11+ </span>
12+ </td>
13+ </tr>
14+ </tbody>
15+</table>
16+^D
17+\begin{longtable}[]{@{}
18+ >{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.00}}@{}}
19+\toprule
20+\endhead
21+{\vtop{\hbox{\strut text}\hbox{\strut text2 }}} \\
22+\bottomrule
23+\end{longtable}
24+```