aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
-rw-r--r--tests/writer.html6
2 files changed, 9 insertions, 2 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
diff --git a/tests/writer.html b/tests/writer.html
index cd5a687e0..5f0f86deb 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -1156,9 +1156,11 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
>Images</h1
><p
>From “Voyage dans la Lune” by Georges Melies (1902):</p
- ><p
+ ><div class="figure"
><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
- /></p
+ /><div class="caption"
+ >lalune</div
+ ></div
><p
>Here is a movie <img src="movie.jpg" alt="movie"
/> icon.</p