Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bookmarklet link in Markdown document

How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"??

For example you could have something like:

<a href="javascript:function my_bookmarklet()
                {alert('Hello World');}
                my_bookmarklet();">Hello</a>

But if I try to past the javascript from that into a link in markdown like this:

[Hello World!](javascript:function my_bookmarklet(){alert('Hello World');}my_bookmarklet();)

You get a messed up link, like below.

[Hello World!](javascript:function my_bookmarklet(){alert('Hello World');}my_bookmarklet();)

Is there anyway around this?

And no, I'm not trying to put malicious bookmarklets in SO or anything, but I want to use markdown for my site and would like to post some bookmarklets I wrote.

Edit: I thought I had the answer...but now it seems I don't quite have it.

This seems to work great in WMD and showdown, but in the Markdown.php editor, it does not. Anyone have experience with Markdown.php specifically?

like image 766
Adam Haile Avatar asked Oct 14 '08 23:10

Adam Haile


1 Answers

[Hello World!][1]
[1]:javascript:alert('Hello World')
like image 121
Zombo Avatar answered Sep 20 '22 15:09

Zombo