@@ -140,9 +140,12 @@ pictToRST (label, (attr, src, _, mbtarget)) = do
140 label' <- inlineListToRST label
140 label' <- inlineListToRST label
141 dims <- imageDimsToRST attr
141 dims <- imageDimsToRST attr
142 let (_, cls, _) = attr
142 let (_, cls, _) = attr
143− classes = if null cls
143+ classes = case cls of
144− then empty
144+ [] -> empty
145+ ["align-right"] -> ":align: right"
146+ ["align-left"] -> ":align: left"
147+ ["align-center"] -> ":align: center"
145− else ":class: " <> text (unwords cls)
148+ _ -> ":class: " <> text (unwords cls)
146 return $ nowrap
149 return $ nowrap
147 $ ".. |" <> label' <> "| image:: " <> text src $$ hang 3 empty (classes $$ dims)
150 $ ".. |" <> label' <> "| image:: " <> text src $$ hang 3 empty (classes $$ dims)
148 $$ case mbtarget of
151 $$ case mbtarget of
@@ -218,9 +221,12 @@ blockToRST (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do
218 let fig = "figure:: " <> text src
221 let fig = "figure:: " <> text src
219 alt = ":alt: " <> if null tit then capt else text tit
222 alt = ":alt: " <> if null tit then capt else text tit
220 (_,cls,_) = attr
223 (_,cls,_) = attr
221− classes = if null cls
224+ classes = case cls of
222− then empty
225+ [] -> empty
226+ ["align-right"] -> ":align: right"
227+ ["align-left"] -> ":align: left"
228+ ["align-center"] -> ":align: center"
223− else ":figclass: " <> text (unwords cls)
229+ _ -> ":figclass: " <> text (unwords cls)
224 return $ hang 3 ".. " (fig $$ alt $$ classes $$ dims $+$ capt) $$ blankline
230 return $ hang 3 ".. " (fig $$ alt $$ classes $$ dims $+$ capt) $$ blankline
225blockToRST (Para inlines)
231blockToRST (Para inlines)
226 | LineBreak `elem` inlines =
232 | LineBreak `elem` inlines =