From cb31c89eab45319348b5d8d79dbec5acef8a945b Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 16 Mar 2010 04:06:25 +0000 Subject: HTML writer: implemented image-with-caption feature. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1891 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/HTML.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index a32d63eaf..a05e3c725 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -260,6 +260,11 @@ obfuscateString = concatMap obfuscateChar . decodeCharacterReferences blockToHtml :: WriterOptions -> Block -> State WriterState Html blockToHtml _ Null = return $ noHtml blockToHtml opts (Plain lst) = inlineListToHtml opts lst +blockToHtml opts (Para [Image txt (s,tit)]) = do + img <- inlineToHtml opts (Image txt (s,tit)) + capt <- inlineListToHtml opts txt + return $ thediv ! [theclass "figure"] << + [img, thediv ! [theclass "caption"] << capt] blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph) blockToHtml _ (RawHtml str) = return $ primHtml str blockToHtml _ (HorizontalRule) = return $ hr -- cgit v1.2.3