RST writer: handle images in figures.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1899 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2010-03-18 02:38:58 +00:00
parent 97bff3f9dc
commit 874b574038
2 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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