aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorChristian Despres <50160106+despresc@users.noreply.github.com>2020-09-15 16:36:11 -0400
committerGitHub <noreply@github.com>2020-09-15 13:36:11 -0700
commita2d343420f61591ab1ff82ff4e9db8e87542b6ee (patch)
treed2cc19379c2fc367853c46e51233b56f85d1e16f /test/Tests
parent6ef38e9ab3df2ccee5f605d29c6b94cf94d2b5d3 (diff)
downloadpandoc-a2d343420f61591ab1ff82ff4e9db8e87542b6ee.tar.gz
LaTeX reader: fix improper empty cell filtering (#6689)
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Readers/LaTeX.hs32
1 files changed, 26 insertions, 6 deletions
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs
index 87074e990..c50c91ca1 100644
--- a/test/Tests/Readers/LaTeX.hs
+++ b/test/Tests/Readers/LaTeX.hs
@@ -174,20 +174,21 @@ tests = [ testGroup "tokenization"
, Row nullAttr [ simpleCell (plain "Two") ]
]
, "Table with nested multirow/multicolumn item" =:
- T.unlines [ "\\begin{tabular}{c c c}"
- , "\\multicolumn{2}{c}{\\multirow{2}{5em}{One}}&Two\\\\"
- , "& & Three\\\\"
- , "Four&Five&Six\\\\"
+ T.unlines [ "\\begin{tabular}{c c c c}"
+ , "\\multicolumn{3}{c}{\\multirow{2}{5em}{One}}&Two\\\\"
+ , "\\multicolumn{2}{c}{} & & Three\\\\"
+ , "Four&Five&Six&Seven\\\\"
, "\\end{tabular}"
] =?>
- table' [AlignCenter, AlignCenter, AlignCenter]
- [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 2) (plain "One")
+ table' [AlignCenter, AlignCenter, AlignCenter, AlignCenter]
+ [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 3) (plain "One")
, simpleCell (plain "Two")
]
, Row nullAttr [ simpleCell (plain "Three") ]
, Row nullAttr [ simpleCell (plain "Four")
, simpleCell (plain "Five")
, simpleCell (plain "Six")
+ , simpleCell (plain "Seven")
]
]
, "Table with multicolumn header" =:
@@ -205,6 +206,25 @@ tests = [ testGroup "tokenization"
]
]
(TableFoot nullAttr [])
+ , "Table with normal empty cells" =:
+ T.unlines [ "\\begin{tabular}{|r|r|r|}"
+ , "A & & B \\\\"
+ , " & C &"
+ , "\\end{tabular}"
+ ] =?>
+ table emptyCaption
+ (replicate 3 (AlignRight, ColWidthDefault))
+ (TableHead nullAttr [])
+ [TableBody nullAttr 0 []
+ [Row nullAttr [ simpleCell (plain "A")
+ , emptyCell
+ , simpleCell (plain "B")
+ ]
+ ,Row nullAttr [ emptyCell
+ , simpleCell (plain "C")
+ , emptyCell
+ ]]]
+ (TableFoot nullAttr [])
]
, testGroup "citations"