Attribute references

John Gruber gruber at fedora.net
Sun Jan 9 21:09:53 EST 2005


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

> If you don't mind, my proposition for a syntax would be like this. In 
> the curly brackets, I would allow a list of attributes, ids identified 
> by a leading hash (`#`), and classes identified by a leading dot (`.`). 
> So this thing:
> 
>   ![image](sourceURL){#my-image .my-class width="30" height="30"}
> 
> .... would produce this:
> 
>   <img src="sourceURL" alt="image" id="my-image"
>   class="my-class" width="30" height="30" />
> 
> Of course you can choose to assign an id using `{id="my-id"}`. The hash 
> syntax and the dot syntax for classes is only a shortcut.

No, because I want to get this attribute text out of the main flow
of the document. It's not so bad in your example above, because
you're doing it with an image, but for something like a header or a
paragraph, it'd be no better at all then just using raw HTML tags.

My main goal is to be able to specify any attribute I want, but
without interrupting the flow of the text itself.

If I number my attribute definitions:

    {1}: id="foo"
    ...
    {999}: id="bar"

They'll never take up more than 5 characters in the flow of my text.

The point here is not to make it easier to add attributes than when
using HTML; the point is to make the resulting text easier to read.

-J.G.


More information about the Markdown-Discuss mailing list