Markdown's syntax does not allow for an image to be floated left or right. This makes the use of any images really ugly unless the graphic designer does some work on the theme ahead of time to make all images go one way or another. Of course, then you can't decide on an image-by-image basis which way they float.

The attached patch allows the user to add "left", "right" or "none" after the title to define how the image should be placed in the page flow.

Files: 
CommentFileSizeAuthor
markdown-image-float.diff3 KBJohn Franklin

Comments

This sounds interesting.

Shouldn't there be options for Left/Right/Center/None ?

It could add center, but that's a much more complex patch. This just passes the value on to the CSS float: attribute, and there is no "float: center".

When centering, how would you have the text flow around the element, or would you leave the space left and right of the image blank?

I'm imagining that the text would not flow around the image, if its centered.

I really like this patch. Are we likely to add it into the module, or do you think it should properly be done upstream in the 3rd party Markdown library?

I needed it in my site, so I wrote it. I couldn't imagine I was the only one, so I submitted it here as a patch. Add it or don't add it -- it makes no difference to me. (Ok, maybe it would be a little gratifying to see it added to the module... :) )

Status:Active» Closed (won't fix)

Better image handling in Markdown would be nice, but I don't think this is something we can / should address in the module itself -- this is really an upstream issue, and I think it's unlikely that the maintainers of the Markdown library would add this in.

On a related note, I've often handle image placement with a separate (custom) input format module that provides a "simple tag" for image embedding, and combine that with imagecache to provide size variations as well. Something like the following:

[image: NUMBER / NID, ALIGNMENT, SIZE]

For example:

[image: 1, left, large]

It would be great to see some input format modules that provide this kind of "simple tag" functionality, and to maintain a list of them from the Markdown project page.