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

Viewed 6439

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.

6 Answers

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

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

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.

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

Somehow this:

- [x] Objects Spec Update Idea.md

got turned into a link

Idea.md

leading to

http://idea.md

What I did is enclose it in back tick characters ` like this:

- [x] `Objects Spec Update Idea.md`

(Back tick characters make it format as inline code and seems to keep the characters more in tact more literally in the output.)

I hope this works for some of you too.

If you are using matrix (the chat protocol, https://matrix.org/) or linkifyjs,

then none of the above mentioned are guaranteed to work. (for example, the popular matrix client element uses linkify. However, this will work:

https:/<del></del>/example.<del></del>com should work in any matrix clients that support rich formatting
https:/[]()/example.[]()com  should work
Related