16

As most of you know, putting a link into a post automatically makes it a link (e.g. http://localhost/) We can force the linkification with angle brackets (<http://localhost/>) if the markdown somehow misses it. But (as far as I know) there's no way to force the address to not be made a link. Such a feature would be nice when we need example addresses, there's no reason to have a link to http://www.example.com/, for instance, or http://1.2.3.4/domain.com/, from the question where I thought of this.

I think an easy way to mark this up would be something like <!http://example.com>, making the address appear in plain text without the hyperlink.

This came to my attention in this question: can't open transfered website from old DS to new DS

4
  • As for any nice feature that is not essential for SE sites to operate correctly, I'd say: first convince the author of the Markdown specification...
    – Arjan
    Jan 20, 2012 at 21:12
  • 2
    @arjan technically auto-linking isn't part of the markdown spec. Technically, per the spec, only links in angle brackets are supposed to auto-link, but this is.. not how the world expects things to work these days. Jan 20, 2012 at 21:18
  • True, @Jeff (though I did not even realize that). Still then, defining !<...> would be a deviation from the original Markdown that other parsers won't understand? Bare URLs might simply not be auto-linked by other parsers, but such does not really break the rendering, nor the content. (Related: I like the syntax for spoiler text, which does not break other parsers either.)
    – Arjan
    Jan 20, 2012 at 21:28
  • I thought I was going crazy, because all of the examples here whereby it's not supposed to create a link are appearing as links. Then I remembered I have a Chrome extension that turns non-linked URLs into links.
    – ale
    Jan 21, 2012 at 2:35

3 Answers 3

39

http<nolink>://www.google.com/

http://www.google.com/

Implementation changes might break this, but for now you can use any non-whitelisted HTML-like-code to prevent the auto-linker from kicking in, despite the code being stripped.

This doesn't work in chat or comments.

1
  • 4
    An alternative is to use [http://www.google.com/](). The empty URL part causes the link to not be functional. Mar 17, 2019 at 12:14
20

If you put the link in code tags, it won't be linked automatically.

Like this:

http://stackoverflow.com

What I did was use the backtick `` marks around it, so it works inline, too.http://www.google.com` like that.

This would make semantic sense, too; because if you are wanting to insert a URL but don't want it to operate as a link, it's almost always because it's in code, or a value for some code.

4
  • 3
    I know it doesn't link in code, but I feel that unnecessarily highlights the address. I just want it to look like normal text.
    – Kevin
    Jan 20, 2012 at 21:05
  • 1
    I think the use for that would be minimal (though obviously, you disagree). I suppose you could always do something like insert the HTML code for a zero-width space or some such. Jan 20, 2012 at 21:06
  • 3
    Can't you just drop the http:// then, @Kevin?
    – Arjan
    Jan 20, 2012 at 21:15
  • 3
    @arjan that was also the answer when this came up recently in the context of "why can't the tooltip text for a URL itself be a hyperlink too", which I consider a rather.. insanely obscure.. request. Jan 20, 2012 at 21:19
2

You can use the &period; markup code for the dot in, e.g., dot com:

This should not be automatically parsed: just-text&period;com
2
  • 1
    https:// seems to be required. At least here. Jan 25, 2023 at 1:52
  • Well the preview parse the link even with &period; however when actually posted it's not parsed. Jan 25, 2023 at 11:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .