diff options
author | despresc <christian.j.j.despres@gmail.com> | 2020-04-09 20:08:49 -0400 |
---|---|---|
committer | despresc <christian.j.j.despres@gmail.com> | 2020-04-15 23:03:22 -0400 |
commit | c7814f31e155da212bd3323294db08fe1f4d8ab9 (patch) | |
tree | 9b933ba5d6071bf7e8ca6a17af71cc2780174e7f /test/Tests/Readers/LaTeX.hs | |
parent | d368536a4ebfc542a58bd9bec6718590711c6efb (diff) | |
download | pandoc-c7814f31e155da212bd3323294db08fe1f4d8ab9.tar.gz |
Use the new builders, modify readers to preserve empty headers
The Builder.simpleTable now only adds a row to the TableHead when the
given header row is not null. This uncovered an inconsistency in the
readers: some would unconditionally emit a header filled with empty
cells, even if the header was not present. Now every reader has the
conditional behaviour. Only the XWiki writer depended on the header
row being always present; it now pads its head as necessary.
Diffstat (limited to 'test/Tests/Readers/LaTeX.hs')
-rw-r--r-- | test/Tests/Readers/LaTeX.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs index 5cddab871..821747f26 100644 --- a/test/Tests/Readers/LaTeX.hs +++ b/test/Tests/Readers/LaTeX.hs @@ -36,8 +36,14 @@ infix 4 =: (=:) = test latex simpleTable' :: [Alignment] -> [[Blocks]] -> Blocks -simpleTable' aligns = table "" (zip aligns (repeat ColWidthDefault)) - (map (const mempty) aligns) +simpleTable' aligns rows + = table emptyCaption + (zip aligns (repeat ColWidthDefault)) + (TableHead nullAttr []) + [TableBody nullAttr 0 [] $ map toRow rows] + (TableFoot nullAttr []) + where + toRow = Row nullAttr . map simpleCell tokUntokRt :: String -> Bool tokUntokRt s = untokenize (tokenize "random" t) == t |