Sticky Textile block formatting

I’ve been trying to find some easy way to use Textile formatting in this blog to create multiple-paragraph blockquotes, in which all the paragraphs are contained within a single <blockquote> tag. For example, the code generated by MT-Textile should look like this:

<blockquote><p>This is the first paragraph.</p>

<p>This is the second paragraph.</p></blockquote>

Which should render something like this:

This is the first paragraph.

This is the second paragraph.

Up to this point, I’ve been using a separate bq. formatting directive for every paragraph in the blockquote. The Textile source looks like this:

==

bq. This is the first paragraph.

This is the second paragraph.


==

The problem with this is that it generates two <blockquote> tags, like this:

<blockquote><p>This is the first paragraph.</p></blockquote>

<blockquote><p>This is the second paragraph.</p></blockquote>

This wouldn’t be a big deal, except that I’m thinking of changing the CSS formatting for a <blockquote> tag to something with a different background color, or perhaps surrounded by a box, and I don’t want separate individual boxes appearing for each paragraph of the blockquote, as in this example:

This is the first paragraph.

This is the second paragraph.

Fortunately, MT-Textile 2 has syntax that solves this problem. Brad Choate, the author of MT-Textile, doesn’t have all the new syntax properly documented yet (MT-Textile’s still in beta, so it’s forgivable), but one of his test case pages has provided me with a wealth of new tags that already work in MT-Textile 2. Thank goodness for Google, which produced the test case page with the search terms “textile multiple paragraph blockquote”.

The new syntax that makes my little dreams come true is the “sticky” indicator, formed by tacking a second period (full stop for those of you on the other side of the Atlantic) onto the end of the bq. directive. The proper MT-Textile 2 formatting for my example looks like this:

bq.. This is the first paragraph.

This is the second paragraph.

To end the sticky behavior, simply start the next paragraph with p.. It’s an elegant solution for an elegant markup system.

The more I look at MT-Textile 2, the more in awe I am of Brad and Dean Allen, Textile’s original creator. Their collaboration is producing an easy to type markup that’s remarkably intuitive to use. I wasn’t really using the original MT-Textile much, instead dropping HTML coding into my blog entries. Now that I’ve started digging through the second version’s hidden features, I’m tapping out all my blog entries using Textile. It’s a lot easier to key in, and a heck of a lot more readable for not having to visually parse angle brackets. Bravo, Brad and Dean!

One Comment

  1. Henry Todd
    Posted November 26, 2005 at 2:42 pm | Permalink

    You can achieve the same effect with vanilla Textile by putting a space before your <blockquote> tag. For instance:

     <blockquote>

    This is the first paragraph.

    This is the second paragraph.

     </blockquote>

    This also has the advantage of letting you use the “cite” attribute.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*