Extending markdown?

Michel Fortin michel.fortin at michelf.com
Sat Jul 23 09:05:05 EDT 2005


Le 23 juil. 2005, à 8:11, A. Pagaltzis a écrit :


> * MDK <michaldominik at gmail.com> [2005-07-23 13:35]:

>

>> 1. Image linking. It often happens, that you post a thumbnail image

>> being a link to the full-size image (think: photos, screenshots...).

>> It

>> would be nice to extend the ![]() to support an image being a link to

>> something. Say: ![alt text](img src){link address}

>

> Use standard Markdown syntax: an image as the text of a link tag.

>

> [![alt text](thumbnail.jpg)](big_image.png)

>

> That’s it.


But I don't think I have to point out that the current syntax is hard
to figure out. I think Michael Dominic K. has an interesting idea here,
but I would do it a little differently:

![alt text](image.jpg)(/link/url)
![alt text][image](/link/url)
![alt text](image.jpg)[link]
![alt text][image][link]

[image]: image.jpg
[link]: /link/url

So you could define an image-link like this:

1. An exclamation mark (!);
2. Followed by alt text for the image between square brackets;
3. Followed by an URL to the image between parenthesis *or* a
reference to that URL between square brackets.
4. Followed by an URL for the link between parenthesis *or* a
reference to that URL between square brackets.

The four preceding lines would give you this exact same thing:

<a href="/link/url"><img alt="alt text" src="image.jpg"></a>

Additional Markdown features can still work:

* You can include an image title in the first parenthesis.

* You can include a link title in the second parenthesis.

* You can leave empty the any of the references, or both if you
want to. For instance:

![my image][][]

[my image]: image.jpg

would give you a link pointing to the image itself:

<a href="image.jpg"><img alt="my image" src="image.jpg"></a>


So, who think this could be useful?


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/


More information about the Markdown-Discuss mailing list