sample.lua - define CaptionedImage, add newline at end.

Cloess #2393.
This commit is contained in:
John MacFarlane 2015-09-15 09:27:45 -07:00
parent 6dcfa7e07b
commit f2f35224f6

View file

@ -84,7 +84,7 @@ function Doc(body, metadata, variables)
end
add('</ol>')
end
return table.concat(buffer,'\n')
return table.concat(buffer,'\n') .. '\n'
end
-- The functions that follow render corresponding pandoc elements.
@ -251,6 +251,12 @@ function html_align(align)
end
end
function CaptionedImage(src, tit, caption)
return '<div class="figure">\n<img src="' .. escape(src,true) ..
'" title="' .. escape(tit,true) .. '"/>\n' ..
'<p class="caption">' .. caption .. '</p>\n</div>'
end
-- Caption is a string, aligns is an array of strings,
-- widths is an array of floats, headers is an array of
-- strings, rows is an array of arrays of strings.