aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Schenner <mathias.schenner@langsci-press.org>2015-03-08 15:30:05 +0100
committerMathias Schenner <mathias.schenner@langsci-press.org>2015-03-08 15:39:18 +0100
commit1e3ef0e36f8576bf87115ece66675b56651c7a28 (patch)
tree92a2e27788d32b92e86c239087bb6f77ad6f7abf
parent4f9a10619ff3f6ed93da49498d369380b0436f1c (diff)
downloadpandoc-1e3ef0e36f8576bf87115ece66675b56651c7a28.tar.gz
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.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--tests/Tests/Readers/LaTeX.hs3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index a071578fe..8689fde45 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1314,7 +1314,7 @@ parseTableRow cols = try $ do
simpTable :: Bool -> LP Blocks
simpTable hasWidthParameter = try $ do
when hasWidthParameter $ () <$ (spaces >> tok)
- spaces
+ skipopts
aligns <- parseAligns
let cols = length aligns
optional hline
diff --git a/tests/Tests/Readers/LaTeX.hs b/tests/Tests/Readers/LaTeX.hs
index d5ab7a370..614075652 100644
--- a/tests/Tests/Readers/LaTeX.hs
+++ b/tests/Tests/Readers/LaTeX.hs
@@ -91,6 +91,9 @@ tests = [ testGroup "basic"
, "Table with empty column separators" =:
"\\begin{tabular}{@{}r@{}l}One & Two\\\\ \\end{tabular}" =?>
simpleTable' [AlignRight,AlignLeft] [[plain "One", plain "Two"]]
+ , "Table with vertical alignment argument" =:
+ "\\begin{tabular}[t]{r|r}One & Two\\\\ \\end{tabular}" =?>
+ simpleTable' [AlignRight,AlignRight] [[plain "One", plain "Two"]]
]
, testGroup "citations"