From a2d343420f61591ab1ff82ff4e9db8e87542b6ee Mon Sep 17 00:00:00 2001 From: Christian Despres <50160106+despresc@users.noreply.github.com> Date: Tue, 15 Sep 2020 16:36:11 -0400 Subject: LaTeX reader: fix improper empty cell filtering (#6689) --- test/Tests/Readers/LaTeX.hs | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'test/Tests') 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" -- cgit v1.2.3