mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
```
|
||||
Reference in New Issue
Block a user