aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-08-23 09:18:12 -0700
committerJohn MacFarlane <[email protected]>2022-08-23 09:18:12 -0700
commit393a37fc2ae086eb82d93e48e0b4d9497825f6dc (patch)
treeb221e77b8ddb2e6eb30496e296e4902e58effab1 /src
parentca6cb63357681dc7e7f910f8d0eba175c86a35be (diff)
LaTeX reader: skip parenthenized args of toprule, midrule, etc.
Closes #8242.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Table.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Table.hs b/src/Text/Pandoc/Readers/LaTeX/Table.hs
index 234c7da25..629773781 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Table.hs
@@ -40,17 +40,18 @@ tableEnvironments blocks inline =
hline :: PandocMonad m => LP m ()
hline = try $ do
spaces
- controlSeq "hline" <|>
- (controlSeq "cline" <* braced) <|>
- -- booktabs rules:
- controlSeq "toprule" <|>
- controlSeq "bottomrule" <|>
- controlSeq "midrule" <|>
- controlSeq "endhead" <|>
- controlSeq "endfirsthead"
- spaces
+ hasParenArg <-
+ (False <$ controlSeq "hline") <|>
+ (False <$ controlSeq "cline") <|>
+ (True <$ controlSeq "cmidrule") <|>
+ -- booktabs rules:
+ (True <$ controlSeq "toprule") <|>
+ (True <$ controlSeq "bottomrule") <|>
+ (True <$ controlSeq "midrule") <|>
+ (True <$ controlSeq "endhead") <|>
+ (True <$ controlSeq "endfirsthead")
optional rawopt
- return ()
+ when hasParenArg $ void $ optional (parenWrapped (() <$ singleChar))
lbreak :: PandocMonad m => LP m Tok
lbreak = (controlSeq "\\" <|> controlSeq "tabularnewline")