git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: allow valign argument in tables

The `tabular` environment takes an optional parameter for vertical alignment. Previously, pandoc would fail to parse tables if this parameter was present. With this commit, the parameter is still ignored, but the table gets parsed. A test case is included.

commit1e3ef0e36f8576bf87115ece66675b56651c7a28 authorMathias Schenner <mathias.schenner@langsci-press.org> dateSun 8 Mar 2015, 15:30 (12 years ago) parent4f9a106
2 files changed+4−1
src/Text/Pandoc/Readers/LaTeX.hs+1−1 tests/Tests/Readers/LaTeX.hs+3
src/Text/Pandoc/Readers/LaTeX.hs+1−1
@@ -1314,7 +1314,7 @@ parseTableRow cols = try $ do
13141314simpTable :: Bool -> LP Blocks
13151315simpTable hasWidthParameter = try $ do
13161316 when hasWidthParameter $ () <$ (spaces >> tok)
1317− spaces
1317+ skipopts
13181318 aligns <- parseAligns
13191319 let cols = length aligns
13201320 optional hline
tests/Tests/Readers/LaTeX.hs+3
@@ -91,6 +91,9 @@ tests = [ testGroup "basic"
9191 , "Table with empty column separators" =:
9292 "\\begin{tabular}{@{}r@{}l}One & Two\\\\ \\end{tabular}" =?>
9393 simpleTable' [AlignRight,AlignLeft] [[plain "One", plain "Two"]]
94+ , "Table with vertical alignment argument" =:
95+ "\\begin{tabular}[t]{r|r}One & Two\\\\ \\end{tabular}" =?>
96+ simpleTable' [AlignRight,AlignRight] [[plain "One", plain "Two"]]
9497 ]
9598
9699 , testGroup "citations"