diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 04:06:25 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 04:06:25 +0000 |
commit | cb31c89eab45319348b5d8d79dbec5acef8a945b (patch) | |
tree | d53eae6b438ff90c4ab42ee50539c5c97fa47981 /src/Text/Pandoc | |
parent | 766f2aaeacb0f4ed99cf6f6089e2b3587edfcba1 (diff) | |
download | pandoc-cb31c89eab45319348b5d8d79dbec5acef8a945b.tar.gz |
HTML writer: implemented image-with-caption feature.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1891 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 5 |
1 files changed, 5 insertions, 0 deletions
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 |