This is only a test of posting a link without actually linking to it.
Enclose an URL in code tags to make it behave like text and not a live link.
A code tag is left-squarebracket, the word “code” then right-squarebracket. Like this except without spaces: [ code ] URL goes here [ / code ]
That will work. Thanks.
You can achieve the same effect with less typing using the back-tick or ` symbol in front of and behind the link. On US keyboards that’s generally to the left of the 1/! key.
Typing what looks like this
Which can also be embedded in the middle of a paragraph like this:
https://www.google.com; it doesn’t need to be on a line by itself.
Anything at all typed on the same line with the link will do it. Doesn’t have to be a backtick.
That was a period.
Hope you don’t mind me using this thread to test my ability to reply. I’m getting weird errors in another thread.
I still see a link, which I believe the OP wants to avoid, not just the fancy box.
Here’s my suggestion: put a ​ after the h, like so:
You can even do it inline without it changing the font, like so: https://www.youtube.com
FYI: Timed out on edit of prior post. Trying again …
@thorny_locust: AIUI the OP does not want a clickable link, so the anything-else-on-the-line trick isn’t good enough. Yes, that stops Discourse’s attempt to create a Onebox, but leaves the link clickable.
@BigT: As to the zero width space or other similar trickery, that has the problem that anyone who swipes across the displayed URL and copies it will pick up the bogus space. Then when they paste that into their browser’s address bar the link won’t work. And they’ll have no idea what’s wrong or how to fix it. That’s real unhelpful.
The OP never said why they want this behavior of a fully displayed but unclickable link. Which IMO probably makes this a so-called XY problem, where they’ve assumed the wrong solution to the problem they really have, and are now asking us how to implement that wrong solution, instead of asking how to achieve their actual goal.
I’m gonna bet the OP’s actual goal is to create a non-clickable link as a part of “two-click” protection for something unsafe.
If that’s their goal, it’s probably better for them to use the built-in blur spoiler that’s designed for exactly that purpose. To do that:
- Put the cursor at the spot in your post where you want the URL to go
- Click the gear icon at the right of the edit box’s menu bar.
- Choose the “blur spoiler” option.
- Paste the URL into the gap provided between the two spoiler tags.
The text in the edit box will look like this [spoiler]https://www.google.com[/spoiler] and the result will look like this https://www.google.com. It takes one click to unblur the link and a second click to navigate to it.
I wasn’t trying to make a non-clickable link (although that is an acceptable solution) – I was just trying to avoid the pop-up box and make a normal looking link so those who choose to look at it can but the link doesn’t (partially) auto-open.
The gear icon trick works (without the ‘blur’) to get my intended results as shown in the third post of this thread. Actually that’s not entirely true; in my mind a link is underlined in blue text which isn’t happening here but I am considering it good enough – maybe one day I’ll dabble at adding the underline, but for now I’m content the way it is – maybe the blue underline is old-school hypertext stuff and I’m just used to the old way.
OK; then all you need is something else, anything at all, on the same line with the link.
Which includes simply putting the link https://www.google.com into the middle of the sentence where ever it fits.
IOW, you have to go out of your way to create the auto-opening preview box by putting the URL entirely on a line by itself. Doing anything else creates an ordinary clickable link.
I agree the lack of automatic underlining of links is a little confusing. In some themes links can be hard to pick out, especially when someone does the click here thing and the color constrast on the word “here” is pretty subtle.
For that reason I personally bold those so it looks like click here instead. You can force an underline in addition to or instead of bold by surrounding the link with [u] and [/u]. So click here or click here instead.
The only reason I settled on bold vs underline is there’s an edit menu item and a keyboard shortcut for bolding (Ctrl-B), but there’s neither of those helpful things for underlining. So bolding is less typing.