From f6ad9e263faac85fd132610ad2c7d9cf4f517091 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Jul 2015 10:26:29 -0700 Subject: [PATCH] LaTeX reader: properly handle booktabs lines. Lines aren't part of the pandoc table model, but we can just ignore them. Closes #2307. --- src/Text/Pandoc/Readers/LaTeX.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 411369a05..9ad803881 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1287,7 +1287,16 @@ parseAligns = try $ do return aligns' hline :: LP () -hline = () <$ try (spaces' *> controlSeq "hline" <* spaces') +hline = try $ do + spaces' + controlSeq "hline" <|> + -- booktabs rules: + controlSeq "toprule" <|> + controlSeq "bottomrule" <|> + controlSeq "midrule" + spaces' + optional $ bracketed (many1 (satisfy (/=']'))) + return () lbreak :: LP () lbreak = () <$ try (spaces' *> controlSeq "\\" <* spaces')