Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Commonmark/Extensions/WikiLink.hs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,15 @@ wikilinkSpec =
TODO: extend on top of plainify from heist-extra
-}
plainify :: [B.Inline] -> Text
plainify = W.query $ \case
plainify = W.query plainify' . W.walk (mapMaybe removeInlineNotes)
where
removeInlineNotes :: B.Inline -> Maybe B.Inline
removeInlineNotes = \case
B.Note {} -> Nothing
a -> Just a

plainify' :: [B.Inline] -> Text
plainify' = W.query $ \case
B.Str x -> x
B.Code _attr x -> x
B.Space -> " "
Expand Down