Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown for url without hyperlink #9566

Closed
wmthor opened this issue Apr 14, 2018 · 17 comments
Closed

Markdown for url without hyperlink #9566

wmthor opened this issue Apr 14, 2018 · 17 comments
Assignees

Comments

@wmthor
Copy link

wmthor commented Apr 14, 2018

Is there a way to add urls in the markdown editor without the automatically generated hyperlink? I was surprised to find out that urls were automatically converted to hyperlinks and can't find a way to remove them except for this hack that sort of solves it.

[http://www.url-here-instead.com]()

I would think there needs to be a way to remove the automatically generated hyperlinks, or have it documented if there is. Or perhaps another solution would be to remove the automatically generated hyperlink, as if an author wanted the link they would explicitly specify it with the markdown.

@wmthor wmthor changed the title Markdown for url without hyperlink? Markdown for url without hyperlink Apr 14, 2018
@kevinansfield
Copy link
Member

kevinansfield commented Apr 14, 2018

Hey @wmthor 👋 I'm interested to hear the use case for displaying a full URL that isn't hyperlinked. The only way to avoid full URLs (eg, URLs starting with http:// or https://) being converted to hyperlinks in the markdown editor is to not start them with http(s):// or to wrap them in HTML, eg:

example.com won't be linked because it's not a URL

<div style="display: inline">http://example.com</div> won't be linked because it's inside HTML

I'm going to close this issue because it's the expected behaviour and would be a breaking change if the behaviour was modified. Our new rich-text Koenig editor is currently in development, that won't automatically link URLs because it makes linking text easier than it is in markdown.

@wmthor
Copy link
Author

wmthor commented Apr 15, 2018

Hi, @kevinansfield. Thanks for the response. The div solution works. I understand that changing it drastically would break a lot of things and not worth implementing for such a specific use case. I found that inline code worked as another workaround. Thanks.

@ghost
Copy link

ghost commented Apr 9, 2019

I had the same problem, after much research I was able to solve using the following method.

Desativar links automáticos do Markdown

@lazarevzubov
Copy link

lazarevzubov commented Jun 20, 2019

@kevinansfield
I don't think that it is an expected behavior in ALL cases. For example, it isn't for an inlined code:
Screenshot 2019-06-20 at 10 45 09
Moreover, a hyperlink is automatically generated even if the text link doesn't contain "http" at the beginning.
And this one can't be worked around neither by adding HTML tags, nor by []() MD syntax.

I suggest re-opening the issue.

@kevinansfield
Copy link
Member

@lazarevzubov it looks like you're on an old version of Ghost or you have something else in your environment that is auto-linking the URL. Testing this in Ghost 2.x the URL is not auto linked when using a code card, or inside a code block when using a markdown card

@lazarevzubov
Copy link

@kevinansfield Thanks for your reply!
I'm actually on Ghost 2.23.4 and Ghost-CLI 1.11.0. Used theme – Casper 2.10.2 + Disqus. Nothing else is in related environment is installed as far as I know!

@dnlgrgly
Copy link

Hey guys! 👋
I am having the very same issue, and it's very annoying. As I am trying to parse JSON from the Ghost frontend's API response, it breaks because instead of "href": "url", I get "href": "<a href="url">url</a>, breaking the parsing process.
Is there any workaround or fix @wmthor?

@wmthor
Copy link
Author

wmthor commented Jul 24, 2019

There doesn't seem to be any real fix for it, and the only way is a workaround. For your case, the simplest workaround might be to usehttps<span>://</span>www.github.com, and then do a string replace <span>://</span> to :// in your JSON parser.

@kevinansfield
Copy link
Member

This is starting to sound like it's a completely different issue and I'm not able to reproduce at all.

Could someone experiencing problems please open a new issue and include full details of what's happening? A screencast would be most useful because the descriptions of the issue so far are difficult to follow. Thanks!

@ghost
Copy link

ghost commented Sep 17, 2019

Hello, I do not know if it will be the problem of all, my bog also generated the automatic links, after a while I discovered that was related to the comments of Disqus, I even make a post with Pt-Br about the solution here. https://www.insideblock.com/blog/desativar-links-automaticos-do-markdown-com-jekyll.html

@hbragman
Copy link

It is a problem! I have to describe a configfile, and simple values like camel.springboot.name gets formatted like a link. Very frustrating. It is inside a table using | | |

@hbragman
Copy link

linkMarkDown

@dazlin1
Copy link

dazlin1 commented Nov 26, 2019

I am having the same problem when trying to put a URL into a fenced code block. It is automatically turned into a link. HTML isn't any good here. There must be a solution.

@xamarinermanoj
Copy link

xamarinermanoj commented Nov 9, 2020

There is. Use & # 46 ; (without the spaces) to represent "." character.

@dinaayoub
Copy link

To answer the question on the use case, it's for documentation purposes - for example, on our API i want to instruct people to insert certain information into the URL. e.g.
begin the actual game 'https://latte-blackjack.herokuapp.com/next/{dealerid}'

I don't want them to be able to click that because it won't work. they have to remove {dealerid} and replace it with the uuid our API provides them.

@mdcramer
Copy link

Here's a use case: About.com is a defunct website, so on https://mdcramer.github.io/rank-dynamics/welcome/ I'd prefer that it not automatically hyperlink and send a click to some random website.

I tried using the &-solution above, but it's still linking. (Oddly, it doesn't get auto-linked when I put the markdown into https://stackedit.io.) Following advice from https://stackoverflow.com/a/25707855/852795, I used "About.com" and that did the trick!

That being said, it would be nice to have an easy way to prevent markdown from automatically creating hyperlinks where they are not wanted.

@Mugane
Copy link

Mugane commented Jan 24, 2023

There is. Use & # 46 ; (without the spaces) to represent "." character.

It gets parsed as a link as if you just used a period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants