@@ -757,36 +757,6 @@ opt = bracketed inline <|> (str <$> rawopt)
757757paropt :: PandocMonad m => LP m Inlines
758758paropt = parenWrapped inline
759759
760−rawopt :: PandocMonad m => LP m Text
761−rawopt = try $ do
762− sp
763− inner <- untokenize <$> bracketedToks
764− sp
765− return $ "[" <> inner <> "]"
766−
767−skipopts :: PandocMonad m => LP m ()
768−skipopts = skipMany (void overlaySpecification <|> void rawopt)
769−
770−-- opts in angle brackets are used in beamer
771−overlaySpecification :: PandocMonad m => LP m Text
772−overlaySpecification = try $ do
773− symbol '<'
774− t <- untokenize <$> manyTill overlayTok (symbol '>')
775− -- see issue #3368
776− guard $ not (T.all isLetter t) ||
777− t `elem` ["beamer","presentation", "trans",
778− "handout","article", "second"]
779− return $ "<" <> t <> ">"
780−
781−overlayTok :: PandocMonad m => LP m Tok
782−overlayTok =
783− satisfyTok (\t ->
784− case t of
785− Tok _ Word _ -> True
786− Tok _ Spaces _ -> True
787− Tok _ Symbol c -> c `elem` ["-","+","@","|",":",","]
788− _ -> False)
789−
790760inBrackets :: Inlines -> Inlines
791761inBrackets x = str "[" <> x <> str "]"
792762
@@ -1309,39 +1279,6 @@ processHBox = walk convert
13091279 convert LineBreak = Str ""
13101280 convert x = x
13111281
1312−getRawCommand :: PandocMonad m => Text -> Text -> LP m Text
1313−getRawCommand name txt = do
1314− (_, rawargs) <- withRaw $
1315− case name of
1316− "write" -> do
1317− void $ satisfyTok isWordTok -- digits
1318− void braced
1319− "titleformat" -> do
1320− void braced
1321− skipopts
1322− void $ count 4 braced
1323− "def" ->
1324− void $ manyTill anyTok braced
1325− _ | isFontSizeCommand name -> return ()
1326− | otherwise -> do
1327− skipopts
1328− option "" (try dimenarg)
1329− void $ many braced
1330− return $ txt <> untokenize rawargs
1331−
1332−isFontSizeCommand :: Text -> Bool
1333−isFontSizeCommand "tiny" = True
1334−isFontSizeCommand "scriptsize" = True
1335−isFontSizeCommand "footnotesize" = True
1336−isFontSizeCommand "small" = True
1337−isFontSizeCommand "normalsize" = True
1338−isFontSizeCommand "large" = True
1339−isFontSizeCommand "Large" = True
1340−isFontSizeCommand "LARGE" = True
1341−isFontSizeCommand "huge" = True
1342−isFontSizeCommand "Huge" = True
1343−isFontSizeCommand _ = False
1344−
13451282isBlockCommand :: Text -> Bool
13461283isBlockCommand s =
13471284 s `M.member` (blockCommands :: M.Map Text (LP PandocPure Blocks))