summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-21 10:26:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-21 10:26:29 -0700
commitf6ad9e263faac85fd132610ad2c7d9cf4f517091 (patch)
tree4223303f6b42685bd8d37b57faf95984f178d055 /src
parent7120df9dad6376a6a43b7e870350a016a720a53c (diff)
LaTeX reader: properly handle booktabs lines.
Lines aren't part of the pandoc table model, but we can just ignore them. Closes #2307.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs11
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')