git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Use a p rather than a div for image caption.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1900 788f1e2b-df1e-0410-8736-df70ead52e1b

commita9b0d876d9ec3a0b01be359cc4ab8278bd2d983e authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 18 Mar 2010, 02:39 (17 years ago) parent874b574
3 files changed+4−4
README+1−1 src/Text/Pandoc/Writers/HTML.hs+1−1 tests/writer.html+2−2
README+1−1
@@ -915,7 +915,7 @@ Images with captions
915915An image occurring by itself in a paragraph will be rendered as
916916a figure with a caption. (In LaTeX, a figure environment will be
917917used; in HTML, the image will be placed in a `div` with class
918−`figure`, together with a caption in a `div` with class `caption`.)
918+`figure`, together with a caption in a `p` with class `caption`.)
919919The image's alt text will be used as the caption.
920920
921921 ![This is the caption](/url/of/image.png)
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -264,7 +264,7 @@ blockToHtml opts (Para [Image txt (s,tit)]) = do
264264 img <- inlineToHtml opts (Image txt (s,tit))
265265 capt <- inlineListToHtml opts txt
266266 return $ thediv ! [theclass "figure"] <<
267− [img, thediv ! [theclass "caption"] << capt]
267+ [img, paragraph ! [theclass "caption"] << capt]
268268blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
269269blockToHtml _ (RawHtml str) = return $ primHtml str
270270blockToHtml _ (HorizontalRule) = return $ hr
tests/writer.html+2−2
@@ -1158,8 +1158,8 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
11581158 >From “Voyage dans la Lune” by Georges Melies (1902):</p
11591159 ><div class="figure"
11601160 ><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
1161− /><div class="caption"
1162− >lalune</div
1161+ /><p class="caption"
1162+ >lalune</p
11631163 ></div
11641164 ><p
11651165 >Here is a movie <img src="movie.jpg" alt="movie"