Skip to content

Commit dba428c

Browse files
committed
Use SimpleFigure in ICML writer.
1 parent 5735c6b commit dba428c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Text/Pandoc/Writers/ICML.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE FlexibleContexts #-}
22
{-# LANGUAGE OverloadedStrings #-}
33
{-# LANGUAGE ScopedTypeVariables #-}
4-
{-# LANGUAGE ViewPatterns #-}
54

65
{- |
76
Module : Text.Pandoc.Writers.ICML
@@ -309,9 +308,8 @@ blocksToICML opts style lst = do
309308
-- | Convert a Pandoc block element to ICML.
310309
blockToICML :: PandocMonad m => WriterOptions -> Style -> Block -> WS m (Doc Text)
311310
blockToICML opts style (Plain lst) = parStyle opts style "" lst
312-
-- title beginning with fig: indicates that the image is a figure
313-
blockToICML opts style (Para img@[Image _ txt (_,Text.stripPrefix "fig:" -> Just _)]) = do
314-
figure <- parStyle opts (figureName:style) "" img
311+
blockToICML opts style (SimpleFigure attr txt (src, tit)) = do
312+
figure <- parStyle opts (figureName:style) "" [Image attr txt (src, tit)]
315313
caption <- parStyle opts (imgCaptionName:style) "" txt
316314
return $ intersperseBrs [figure, caption]
317315
blockToICML opts style (Para lst) = parStyle opts (paragraphName:style) "" lst

0 commit comments

Comments
 (0)