Skip to content

Commit

Permalink
Add simple alert handler to C.Pandoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Dec 4, 2023
1 parent 82c8664 commit 786f413
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commonmark-pandoc/src/Commonmark/Pandoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Commonmark.Extensions.DefinitionList
import Commonmark.Extensions.Attributes
import Commonmark.Extensions.Footnote
import Commonmark.Extensions.TaskList
import Commonmark.Extensions.Alerts
import Commonmark.Extensions.Smart
import Data.Char (isSpace)
import Data.Coerce (coerce)
Expand Down Expand Up @@ -144,6 +145,11 @@ instance (Rangeable (Cm a B.Inlines), Rangeable (Cm a B.Blocks))
definitionList _ items =
Cm $ B.definitionList $ map coerce items

instance (Rangeable (Cm a B.Inlines), Rangeable (Cm a B.Blocks))
=> HasAlerts (Cm a B.Inlines) (Cm a B.Blocks) where
alert alertType bs =
Cm $ B.divWith ("",[],[]) $ coerce bs

instance (Rangeable (Cm a B.Inlines), Rangeable (Cm a B.Blocks))
=> HasTaskList (Cm a B.Inlines) (Cm a B.Blocks) where
taskList _ spacing items =
Expand Down

0 comments on commit 786f413

Please sign in to comment.