[kramdown-users] Proposal: block level image tag

Eric Sunshine sunshine at sunshineco.com
Thu Jul 15 03:50:44 EDT 2010

On 7/15/2010 2:21 AM, Thomas Leitner wrote:
> What I could do is to change the current behaviour of kramdown to allow
> standalone, ie. block level, images. A block level image (in contrast to
> a span level image that flows with the text) would be created by
> placing an image link as the only element inside a paragraph, ie:
>      This is a para with ![alt text](image.jpg) and image.
>      ![alt text](image.jpg)
>      The above paragraph contains only an image and therefore will be
>      converted to a block level image tag.
> This would also mitigate an issue raised by Eric Sunshine when
> converting a HTML fragment to kramdown which contains a standalone
> image tag.
> Note, however, that the above change would not allow an image to be the
> only element inside a paragraph - anyone having a use case for such a
> situation?

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 

-- ES

More information about the kramdown-users mailing list