[Latex Reader] Table cell parser not consuming spaces correctly (#6597)

* Added test to replicate (#6596)

* Table cell reader not consuming spaces correctly (#6596)
This commit is contained in:
Laurent P. René de Cotret 2020-08-08 01:45:47 -04:00 committed by GitHub
parent bed62fcf17
commit 499fc11fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -2387,9 +2387,11 @@ parseTableRow envname prefsufs = do
parseTableCell :: PandocMonad m => LP m Cell
parseTableCell = do
spaces
updateState $ \st -> st{ sInTableCell = True }
cell' <- parseMultiCell <|> parseSimpleCell
updateState $ \st -> st{ sInTableCell = False }
spaces
return cell'
cellAlignment :: PandocMonad m => LP m Alignment

View file

@ -148,6 +148,13 @@ tests = [ testGroup "tokenization"
, simpleCell (plain "Two")
]
]
, "table with multicolumn item (#6596)" =:
"\\begin{tabular}{l c r}One & \\multicolumn{2}{c}{Two} & \\\\ \\end{tabular}" =?>
table' [AlignLeft, AlignCenter, AlignRight]
[ Row nullAttr [ simpleCell (plain "One")
, cell AlignCenter (RowSpan 1) (ColSpan 2) (plain "Two")
]
]
, "Table with multirow item" =:
T.unlines ["\\begin{tabular}{c}"
,"\\multirow{2}{c}{One}\\\\Two\\\\"