Skip to content

Commit

Permalink
Use SimpleFigure in ZimWiki writer.
Browse files Browse the repository at this point in the history
  • Loading branch information
argent0 committed Jun 29, 2021
1 parent 615a063 commit 3e2ab7a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Text/Pandoc/Writers/ZimWiki.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{- |
Module : Text.Pandoc.Writers.ZimWiki
Copyright : © 2008-2021 John MacFarlane,
Expand Down Expand Up @@ -86,9 +85,8 @@ blockToZimWiki opts (Div _attrs bs) = do

blockToZimWiki opts (Plain inlines) = inlineListToZimWiki opts inlines

-- title beginning with fig: indicates that the image is a figure
-- ZimWiki doesn't support captions - so combine together alt and caption into alt
blockToZimWiki opts (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just tit)]) = do
blockToZimWiki opts (SimpleFigure attr txt (src, tit)) = do
capt <- if null txt
then return ""
else (" " <>) `fmap` inlineListToZimWiki opts txt
Expand Down

0 comments on commit 3e2ab7a

Please sign in to comment.