HTML writer: implemented image-with-caption feature.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1891 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2010-03-16 04:06:25 +00:00
parent 766f2aaeac
commit cb31c89eab
2 changed files with 9 additions and 2 deletions

View file

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

View file

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