diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 20 | ||||
-rw-r--r-- | test/command/6043.md | 8 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index bfade7284..c7c778193 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -773,7 +773,8 @@ inlineCommand' = try $ do Tok _ (CtrlSeq name) cmd <- anyControlSeq guard $ name /= "begin" && name /= "end" star <- option "" ("*" <$ symbol '*' <* optional sp) - let name' = name <> star + overlay <- option "" overlaySpecification + let name' = name <> star <> overlay let names = ordNub [name', name] -- check non-starred as fallback let raw = do guard $ isInlineCommand name || not (isBlockCommand name) @@ -802,19 +803,18 @@ rawopt = try $ do return $ "[" <> inner <> "]" skipopts :: PandocMonad m => LP m () -skipopts = skipMany (overlaySpecification <|> void rawopt) +skipopts = skipMany (void overlaySpecification <|> void rawopt) -- opts in angle brackets are used in beamer -overlaySpecification :: PandocMonad m => LP m () +overlaySpecification :: PandocMonad m => LP m Text overlaySpecification = try $ do symbol '<' - ts <- manyTill overlayTok (symbol '>') - guard $ case ts of - -- see issue #3368 - [Tok _ Word s] | T.all isLetter s -> s `elem` - ["beamer","presentation", "trans", - "handout","article", "second"] - _ -> True + t <- untokenize <$> manyTill overlayTok (symbol '>') + -- see issue #3368 + guard $ not (T.all isLetter t) || + t `elem` ["beamer","presentation", "trans", + "handout","article", "second"] + return $ "<" <> t <> ">" overlayTok :: PandocMonad m => LP m Tok overlayTok = diff --git a/test/command/6043.md b/test/command/6043.md new file mode 100644 index 000000000..a3f39a44b --- /dev/null +++ b/test/command/6043.md @@ -0,0 +1,8 @@ +``` +% pandoc -t beamer +\textbf<1>{Bold Text On Slide1} +^D +\begin{frame} +\textbf<1>{Bold Text On Slide1} +\end{frame} +``` |