diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 99a3fb434..c0a1c5a88 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -819,7 +819,7 @@ blockQuote = do (do guardEnabled Ext_alerts case raw of (t:ts) | "[!" `T.isPrefixOf` t -> - case T.strip t of + case T.toUpper (T.strip t) of "[!TIP]" -> pure (Just "tip", ts) "[!WARNING]" -> pure (Just "warning", ts) "[!IMPORTANT]" -> pure (Just "important", ts) @@ -834,7 +834,7 @@ blockQuote = do case mbAlert of Nothing -> B.blockQuote <$> contents Just alert -> - (B.divWith ("", [alert], []) + (B.divWith ("", ["alert", alert], []) . (B.divWith ("", ["title"], []) (B.para (B.str (T.toTitle alert))) <>)) <$> contents diff --git a/test/command/9716.md b/test/command/9716.md index 4f340aecc..c7b07f0b5 100644 --- a/test/command/9716.md +++ b/test/command/9716.md @@ -4,7 +4,7 @@ > A suggestion. ^D [ Div - ( "" , [ "tip" ] , [] ) + ( "" , [ "alert" , "tip" ] , [] ) [ Div ( "" , [ "title" ] , [] ) [ Para [ Str "Tip" ] ] , Para [ Str "A" , Space , Str "suggestion." ] ]