[kramdown-users] Proposal: block level image tag

Eric Sunshine sunshine at sunshineco.com
Thu Jul 15 06:24:39 EDT 2010

On 7/15/2010 5:35 AM, Thomas Leitner wrote:
> On 2010-07-15 10:22 +0200 Michael Franzl wrote:
>> On 07/15/2010 09:50 AM, Eric Sunshine wrote:
>>> Taking into account the role of Markdown/kramdown as a tool for
>>> producing nicely marked-up output from simplified input, then it
>>> makes sense for it to function in an intuitive manner for the
>>> common cases even at the expense of the less common cases being a
>>> bit more verbose. Your proposal that the resulting image would be
>>> stand-alone seems the more intuitive of the two outcomes, and thus
>>> sounds quite reasonable. An image within a paragraph is still
>>> possible by adding a bit of (ugly) HTML markup:
>>> <p markdown="1">![alt text](image.jpg)</p>
>>> This sort of added ugliness for the less common case may be a decent
>>> compromise.
>> I agree with Eric on this one. Further, the figure environment allows
>> LaTeX to place the image according to it's high typesetting standards.
> Then off we go implementing this :-) Will be in the 0.10.0 release,
> coming this weekend.

Thinking about this further, I find a couple issues with this proposal 
which concern me.

First, what about the case of a stand-alone clickable image?


I suspect this to be about as common as the stand-alone non-clickable 
image case.  Should this be recognized specially too?

Second, and more seriously, a block-level <img/> tag does not validate 
under strict document types, such as "HTML 4.01 Strict" or "XHTML 1.0 
Strict". I feel quite hesitant about recommending that kramdown generate 
non-validating HTML mark-up as its default behavior (especially since I 
always use "strict" for my websites). One solution to this issue would 
be for kramdown to wrap the stand-alone <img/> automatically in a <div> 
for HTML output, and (as requested) in \begin{figure} for LaTeX output. 
The enclosing <div> would be equally valid for strict and non-strict 
document types.

-- ES

More information about the kramdown-users mailing list