diff options
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 6 | ||||
-rw-r--r-- | tests/writer.rst | 7 |
2 files changed, 11 insertions, 2 deletions
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 diff --git a/tests/writer.rst b/tests/writer.rst index c2ef31b34..e68343b01 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -834,7 +834,11 @@ Images From "Voyage dans la Lune" by Georges Melies (1902): -|lalune| +.. figure:: lalune.jpg + :align: center + :alt: Voyage dans la Lune + + lalune Here is a movie |movie| icon. @@ -885,6 +889,5 @@ indented. In list. -.. |lalune| image:: lalune.jpg .. |movie| image:: movie.jpg |