LaTeX writer: better handling of line breaks in simple tables.

Now we also handle the case where they're embedded in other
elements, e.g. spans. Closes #7272.
This commit is contained in:
John MacFarlane
2021-05-11 07:52:05 -06:00
parent ff7176de80
commit 2bd5d0cafb
2 changed files with 25 additions and 3 deletions
+1 -3
View File
@@ -219,9 +219,7 @@ footRows (Ann.TableFoot _attr rows) = map headerRowCells rows
-- we need to go to some lengths to get line breaks working:
-- as LineBreak bs = \vtop{\hbox{\strut as}\hbox{\strut bs}}.
fixLineBreaks :: Block -> Block
fixLineBreaks (Para ils) = Para $ fixLineBreaks' ils
fixLineBreaks (Plain ils) = Plain $ fixLineBreaks' ils
fixLineBreaks x = x
fixLineBreaks = walk fixLineBreaks'
fixLineBreaks' :: [Inline] -> [Inline]
fixLineBreaks' ils = case splitBy (== LineBreak) ils of
+24
View File
@@ -0,0 +1,24 @@
```
% pandoc -t latex -f html
<table>
<tbody>
<tr>
<td>
<span>
text
<br />
text2
</span>
</td>
</tr>
</tbody>
</table>
^D
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.00}}@{}}
\toprule
\endhead
{\vtop{\hbox{\strut text}\hbox{\strut text2 }}} \\
\bottomrule
\end{longtable}
```