Attribute references

John Gruber gruber at fedora.net
Sun Jan 9 21:16:52 EST 2005


Michel Fortin <michel.fortin at michelf.com> wrote on 01/09/05 at 4:19pm:

> Using my syntax, you can also do this:
> 
>   > There have been a lot of good feature ideas for Markdown
>   > discussed on the Markdown-Discuss mailing list. Among the
>   > features I’d like to add for version 1.1:
>   >
>   > *   A way to specify a `cite` attribute for blockquotes.
> 
>   {cite="http://daringfireball.net/2004/12/markdown_licensing"}

Yeah, in the specific case of cite attributes for blockquotes, it
might actually read better in the source if you include the
attribute inline.

So maybe we support two styles:

    {identifier}
    
    {attribute="value" ... attribute="value"}

If the text in brackets is just an identifier (which for the sake of
argument right now, we'll define as any string of text consisting
only of letters, numbers, and underscores) we look for an attribute
reference definition using the same identifier. If found, we swap in
those attributes. If not fount, the {}-delimited text is left alone
(i.e. they're just literal brackets.)

If the text in brackets consists of `attr="val"` pairs, then we swap
in those attributes.

-J.G.


More information about the Markdown-Discuss mailing list