git.iko.soy/typeable/pandoc
on master help sign in
[Latex Reader] Table cell parser not consuming spaces correctly (#6597)

* Added test to replicate (#6596) * Table cell reader not consuming spaces correctly (#6596)

commit499fc11fca83cf4991cb9bce223fa3d046d4fa68 authorLaurent P. René de Cotret <LaurentRDC@users.noreply.github.com> dateSat 8 Aug 2020, 01:45 (6 years ago) parentbed62fc
2 files changed+9
src/Text/Pandoc/Readers/LaTeX.hs+2 test/Tests/Readers/LaTeX.hs+7
src/Text/Pandoc/Readers/LaTeX.hs+2
@@ -2387,9 +2387,11 @@ parseTableRow envname prefsufs = do
23872387
23882388parseTableCell :: PandocMonad m => LP m Cell
23892389parseTableCell = do
2390+ spaces
23902391 updateState $ \st -> st{ sInTableCell = True }
23912392 cell' <- parseMultiCell <|> parseSimpleCell
23922393 updateState $ \st -> st{ sInTableCell = False }
2394+ spaces
23932395 return cell'
23942396
23952397cellAlignment :: PandocMonad m => LP m Alignment
test/Tests/Readers/LaTeX.hs+7
@@ -148,6 +148,13 @@ tests = [ testGroup "tokenization"
148148 , simpleCell (plain "Two")
149149 ]
150150 ]
151+ , "table with multicolumn item (#6596)" =:
152+ "\\begin{tabular}{l c r}One & \\multicolumn{2}{c}{Two} & \\\\ \\end{tabular}" =?>
153+ table' [AlignLeft, AlignCenter, AlignRight]
154+ [ Row nullAttr [ simpleCell (plain "One")
155+ , cell AlignCenter (RowSpan 1) (ColSpan 2) (plain "Two")
156+ ]
157+ ]
151158 , "Table with multirow item" =:
152159 T.unlines ["\\begin{tabular}{c}"
153160 ,"\\multirow{2}{c}{One}\\\\Two\\\\"