From 874b57403846f2cfcab87100ed19a6c2c8a8db87 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 18 Mar 2010 02:38:58 +0000 Subject: RST writer: handle images in figures. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1899 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/RST.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index bcffb0693..534c34c09 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -145,6 +145,12 @@ blockToRST Null = return empty blockToRST (Plain inlines) = do opts <- get >>= (return . stOptions) wrappedRST opts inlines +blockToRST (Para [Image txt (src,tit)]) = do + capt <- inlineListToRST txt + let fig = text "figure:: " <> text src + let align = text ":align: center" + let alt = text ":alt: " <> if null tit then capt else text tit + return $ (text ".. " <> (fig $$ align $$ alt $$ text "" $$ capt)) $$ text "" blockToRST (Para inlines) = do opts <- get >>= (return . stOptions) contents <- wrappedRST opts inlines -- cgit v1.2.3