Skip to content

Commit 94ef82f

Browse files
committed
Use SimpleFigure in FB2 writer.
1 parent e5e6919 commit 94ef82f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Text/Pandoc/Writers/FB2.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,8 @@ blockToXml :: PandocMonad m => Block -> FBM m [Content]
299299
blockToXml (Plain ss) = cMapM toXml ss -- FIXME: can lead to malformed FB2
300300
blockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula
301301
-- title beginning with fig: indicates that the image is a figure
302-
blockToXml (Para [Image atr alt (src,tgt)])
303-
| Just tit <- T.stripPrefix "fig:" tgt
304-
= insertImage NormalImage (Image atr alt (src,tit))
302+
blockToXml (SimpleFigure atr alt (src, tit)) =
303+
insertImage NormalImage (Image atr alt (src,tit))
305304
blockToXml (Para ss) = list . el "p" <$> cMapM toXml ss
306305
blockToXml (CodeBlock _ s) = return . spaceBeforeAfter .
307306
map (el "p" . el "code") . T.lines $ s

0 commit comments

Comments
 (0)