diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-07-21 10:26:29 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-07-21 10:26:29 -0700 |
commit | f6ad9e263faac85fd132610ad2c7d9cf4f517091 (patch) | |
tree | 4223303f6b42685bd8d37b57faf95984f178d055 | |
parent | 7120df9dad6376a6a43b7e870350a016a720a53c (diff) | |
download | pandoc-f6ad9e263faac85fd132610ad2c7d9cf4f517091.tar.gz |
LaTeX reader: properly handle booktabs lines.
Lines aren't part of the pandoc table model, but we can just
ignore them.
Closes #2307.
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 11 |
1 files changed, 10 insertions, 1 deletions
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') |