git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Use a p rather than a div for image caption.
a9b0d87fiddlosopher
README+1−1
@@ -915,7 +915,7 @@ Images with captions
915An image occurring by itself in a paragraph will be rendered as
915An image occurring by itself in a paragraph will be rendered as
916a figure with a caption. (In LaTeX, a figure environment will be
916a figure with a caption. (In LaTeX, a figure environment will be
917used; in HTML, the image will be placed in a `div` with class
917used; 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`.)
919The image's alt text will be used as the caption.
919The image's alt text will be used as the caption.
920
920
921 ![This is the caption](/url/of/image.png)
921 ![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
264 img <- inlineToHtml opts (Image txt (s,tit))
264 img <- inlineToHtml opts (Image txt (s,tit))
265 capt <- inlineListToHtml opts txt
265 capt <- inlineListToHtml opts txt
266 return $ thediv ! [theclass "figure"] <<
266 return $ thediv ! [theclass "figure"] <<
267− [img, thediv ! [theclass "caption"] << capt]
267+ [img, paragraph ! [theclass "caption"] << capt]
268blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
268blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
269blockToHtml _ (RawHtml str) = return $ primHtml str
269blockToHtml _ (RawHtml str) = return $ primHtml str
270blockToHtml _ (HorizontalRule) = return $ hr
270blockToHtml _ (HorizontalRule) = return $ hr
tests/writer.html+2−2
@@ -1158,8 +1158,8 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
1158 >From “Voyage dans la Lune” by Georges Melies (1902):</p
1158 >From “Voyage dans la Lune” by Georges Melies (1902):</p
1159 ><div class="figure"
1159 ><div class="figure"
1160 ><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
1160 ><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
1161− /><div class="caption"
1161+ /><p class="caption"
1162− >lalune</div
1162+ >lalune</p
1163 ></div
1163 ></div
1164 ><p
1164 ><p
1165 >Here is a movie <img src="movie.jpg" alt="movie"
1165 >Here is a movie <img src="movie.jpg" alt="movie"