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:
parent
766f2aaeac
commit
cb31c89eab
2 changed files with 9 additions and 2 deletions
|
@ -260,6 +260,11 @@ obfuscateString = concatMap obfuscateChar . decodeCharacterReferences
|
||||||
blockToHtml :: WriterOptions -> Block -> State WriterState Html
|
blockToHtml :: WriterOptions -> Block -> State WriterState Html
|
||||||
blockToHtml _ Null = return $ noHtml
|
blockToHtml _ Null = return $ noHtml
|
||||||
blockToHtml opts (Plain lst) = inlineListToHtml opts lst
|
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 opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
|
||||||
blockToHtml _ (RawHtml str) = return $ primHtml str
|
blockToHtml _ (RawHtml str) = return $ primHtml str
|
||||||
blockToHtml _ (HorizontalRule) = return $ hr
|
blockToHtml _ (HorizontalRule) = return $ hr
|
||||||
|
|
|
@ -1156,9 +1156,11 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
|
||||||
>Images</h1
|
>Images</h1
|
||||||
><p
|
><p
|
||||||
>From “Voyage dans la Lune” by Georges Melies (1902):</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"
|
><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
|
||||||
/></p
|
/><div class="caption"
|
||||||
|
>lalune</div
|
||||||
|
></div
|
||||||
><p
|
><p
|
||||||
>Here is a movie <img src="movie.jpg" alt="movie"
|
>Here is a movie <img src="movie.jpg" alt="movie"
|
||||||
/> icon.</p
|
/> icon.</p
|
||||||
|
|
Loading…
Reference in a new issue