Image paths

Aaron VonderHaar gruen0aermel at gmail.com
Tue Nov 8 01:05:26 EST 2005


In my personal opinion, wiring up correct path names is outside the
realm of Markdown's text-to-HTML mission, so let me offer an option
you may not have considered...

Just pre-process your markdown input with a simple script like the
following, (assuming you've got OS-X, which ships with sed)

cat input.txt | sed -e
's#!\[\([^]]*\)\](\(.*\.\(jpg\|png\|gif\)\))#![\1](http://www.domain.com/folder1/folder2/folder3/\2)#g'

| markdown.pl > output.html


Well, maybe "simple" isn't the right word. Anyway, it's a solution to
consider for you first example. (Though I'm not sure how you could
integrate that with markdown-php.)

--Aaron V.

On 07/11/05, robert mcgonegal <robert37 at gmail.com> wrote:

> Often all of my images on a page have the same long, convoluted path.

> Has a separate "reference style" path ever been considered? eg.

>

> ![alt text](pic1.jpg)

>

> ![alt text](pic2.jpg)

>

> ![alt text](pic3.jpg)

>

> I'd even prefer

>

> !(pic4.jpg)

> [alt text goes here below the image name]

>

> And somewhere in the file, a path to apply to all of them:

>

> !path(http://www.domain.com/folder1/folder2/folder3/)

>

> Of course it would have to ignore the images that do have path info.

> Not being much with regular expressions, thats easy for me to say. Is

> this feasible?

>

> Robert McGonegal

> _______________________________________________

> Markdown-Discuss mailing list

> Markdown-Discuss at six.pairlist.net

> http://six.pairlist.net/mailman/listinfo/markdown-discuss

>



More information about the Markdown-Discuss mailing list