Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid hyperlink creation when writing down URIs in markdown?

I would like to know how to avoid the automatic generation of links when I write down an URI in a site that accepts Markdown Language.

I know how to do it in this forum, by making use of the code blocks (for example): http://stackoverflow.com

But this trick doesn't work in some places (for example in http://datahub.io).

So given the basic markdown as described here: http://daringfireball.net/projects/markdown/syntax , how could I write down URIs to make them as plain text when parsed (or maybe, how to avoid the parser for a chunk of text, I suppose that would make the trick as well).

Any suggestion would be good appreciated.

JesĂşs.

like image 913
Jesus Avatar asked Dec 10 '13 10:12

Jesus


4 Answers

I'm sure there is a better way, but this very nasty hack seems to do the trick:

http[]()://example.com/

I've jammed Markdown's radar with some empty markup (an empty link with no text).

like image 58
Mark Wainwright Avatar answered Oct 19 '22 17:10

Mark Wainwright


I'm guessing nobody no mentioned this because it's anathema for markdown.... but you can just do this:

<span>https://example.com</span>

đź‘Ť

like image 45
wle8300 Avatar answered Oct 19 '22 17:10

wle8300


One solution to this is the use of HTML character entity references (AKA character codes):

https&#58;&#47;&#47;www&period;example&period;com

example&period;com

This evalutes to:

https://www.example.com

example.com

You can use one of the named entities or the code point in decimal (&#nnnn;) or hexadecimal (&#xhhhh;) form, for any character that might trigger link detection.

like image 4
TheFreeman193 Avatar answered Oct 19 '22 18:10

TheFreeman193


A more aesthetically pleasing alternative to the first answer (breaking up the URL with []()) is to insert your own HTML-like tag—call it whatever makes sense to you:

https<nolink>://example.com

Look Ma, no hyperlink!
https://example.com

Credit: https://meta.stackexchange.com/a/119811/411046

like image 3
Kal Avatar answered Oct 19 '22 17:10

Kal