@@ -773,7 +773,8 @@ inlineCommand' = try $ do
773773 Tok _ (CtrlSeq name) cmd <- anyControlSeq
774774 guard $ name /= "begin" && name /= "end"
775775 star <- option "" ("*" <$ symbol '*' <* optional sp)
776− let name' = name <> star
776+ overlay <- option "" overlaySpecification
777+ let name' = name <> star <> overlay
777778 let names = ordNub [name', name] -- check non-starred as fallback
778779 let raw = do
779780 guard $ isInlineCommand name || not (isBlockCommand name)
@@ -802,19 +803,18 @@ rawopt = try $ do
802803 return $ "[" <> inner <> "]"
803804
804805skipopts :: PandocMonad m => LP m ()
805−skipopts = skipMany (overlaySpecification <|> void rawopt)
806+skipopts = skipMany (void overlaySpecification <|> void rawopt)
806807
807808-- opts in angle brackets are used in beamer
808−overlaySpecification :: PandocMonad m => LP m ()
809+overlaySpecification :: PandocMonad m => LP m Text
809810overlaySpecification = try $ do
810811 symbol '<'
811− ts <- manyTill overlayTok (symbol '>')
812− guard $ case ts of
813− -- see issue #3368
814− [Tok _ Word s] | T.all isLetter s -> s `elem`
815− ["beamer","presentation", "trans",
816− "handout","article", "second"]
817− _ -> True
812+ t <- untokenize <$> manyTill overlayTok (symbol '>')
813+ -- see issue #3368
814+ guard $ not (T.all isLetter t) ||
815+ t `elem` ["beamer","presentation", "trans",
816+ "handout","article", "second"]
817+ return $ "<" <> t <> ">"
818818
819819overlayTok :: PandocMonad m => LP m Tok
820820overlayTok =