Asset captions [15.07.2008]

The 'Bluedown' text formatter has had an upgrade, providing marked-up caption text for images inserted into text fields.

As you know, you can insert an image into text with the following syntax:

[[example]]

Which results in markup like this:

<img alt="Example" src="/static/files/assets/4068c115/example.jpg" title="Example" />

There are a bunch of options you can add to the asset tag, such as:

[[example|class=left,size=thumb]]

Which modify the resultant HTML in certain ways:

<img alt="Example" class="left" src="/static/files/assets/4068c115/example_thumb.jpg" title="Example" />

Just added is the ability to do captions, by attaching parenthesised text to the end of the asset tag:

[[example]](This is a free markdown area, until the next closing parenthesis not 
preceded by a backslash. So this won't close the caption: \) but this *will*: )

Which gives markup like the following:

<div class="captioned">
  <img alt="Example" src="/static/files/assets/4068c115/example.jpg" title="Example" />
  <blockquote><p>This is a free markdown area, until the next closing parenthesis not 
  preceded by a backslash. So this won't close the caption: ) but this <em>will</em>: </p></blockquote>
</div>

That is, the image tag is enclosed in a div tag with the class captioned, which also contains a blockquote containing the marked-up caption text. You can then style this however you like with CSS.

Only the comment field is required. Omitting the ID fields increases your risk of being mistaken for spam.

Preview or