LaTeX reader: properly handle booktabs lines.
Lines aren't part of the pandoc table model, but we can just
ignore them.
Closes #2307.
commitf6ad9e263faac85fd132610ad2c7d9cf4f517091
authorJohn MacFarlane <jgm@berkeley.edu>
dateTue 21 Jul 2015, 10:26 (11 years ago)
parent7120df9
src/Text/Pandoc/Readers/LaTeX.hs+10−1
@@ -1287,7 +1287,16 @@ parseAligns = try $ do
12871287 return aligns'
12881288
12891289hline :: LP ()
1290−hline = () <$ try (spaces' *> controlSeq "hline" <* spaces')
1290+hline = try $ do
1291+ spaces'
1292+ controlSeq "hline" <|>
1293+ -- booktabs rules:
1294+ controlSeq "toprule" <|>
1295+ controlSeq "bottomrule" <|>
1296+ controlSeq "midrule"
1297+ spaces'
1298+ optional $ bracketed (many1 (satisfy (/=']')))
1299+ return ()
12911300
12921301lbreak :: LP ()
12931302lbreak = () <$ try (spaces' *> controlSeq "\\" <* spaces')