Home / GitHub Page

RFC: Disable automatic link creation?

Wasn't sure whether to post this under Features or Support, but currently, Joplin will auto-create hyperlinks in the viewer tab even though I'm not using the Markdown code to create links.

Is there a way to disable this behavior?

Currently, I'm on version 1.0.233 on Windows 10. I am also seeing the same behavior on Android 10, Joplin version 1.0.336.

1 Like

Yes, you can put the link in a codeblock or use inline code.

`https://example.com`

All markdown editors or modules that render markdown do this. Joplin is no exception.

If I put it in a code block, it changes the formatting of the text, which is something I would like to avoid.

Admittedly I haven’t used that many other Markdown editors, but Dingus does not have this behavior, and it is my understanding that Dingus was made by the creator of Markdown. The only other Markdown editor I’ve used was found in a mobile app called FAT for optional note-taking, and it also does not exhibit this behavior.

I’m hoping at the very least this can become an optional feature for Joplin that can be turned on or off.

It’s fairly easy to add an option, but I’m not sure Laurent wants to introduce such a setting.

If he approves, I can add it within a couple of minutes.

1 Like

I’ll keep my fingers crossed then. Thanks for responding!

I don’t recommend adding this option, because this requirement is too rare, why don’t you want to render links as links?

If you only want to occasionally prevent links from rendering as clickable URLs you can use something like a <span> tag to “break up” the link. This stops the URL rendering but preserves the body font style (unlike code blocks).

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

Not ideal if you want every link unrendered, but it’s a workaround.

In my situation, i don’t want them to render as links because they aren’t links.

I’m using a specific kind of notation to write down fighting game combos, so I end up with a lot of stuff like st.MK, cr.MP, j.HK, etc that are all treated as links. Then when I view my notes, the formatting is now inconsistent because somewhat random bits of the combo are highlighted and underlined for no reason.

Also, I think I just philosophically disagree with the decision to automatically generate links when there’s already functionality within the markup specifically to create links.

1 Like

Yeah, it still messes up the markup, but good to know there’s a workaround. Thanks for this!
I’ll definitely be making use of it.

If you are doing a lot of this notation and adding the <span> tags would be too much of a chore or is messing up your markdown too much, there is also the option of overriding the hyperlink display values.

This, if placed in userstyle.css, will change the colour of links back to the Joplin default rgb(85,85,85) and remove the underlines. They will still be links but they won’t look like it. That way you could use your notation in its plain state.

a {
    color: rgb(85,85,85);
    /* set link colour to default Joplin body text colour */
    text-decoration: none;
    /* remove link underlines*/
}

The downside is that all links will be affected by this change.

EDIT:

If you wish to retain URL highlighting in your other notes adding this to the begining of the markdown for notes containing your game notation will override the URL highlighting for that note only.

<style>
a {
    color: rgb(85,85,85);
    /* set link colour to default Joplin body text colour */
    text-decoration: none;
    /* remove link underlines*/
}
</style>
3 Likes

Oh, nice! I was wondering if CSS would work as a workaround. Using an internal style sheet per note seems like the best solution for me.

Thanks again!

EDIT: Protip for others; Default RGB values for Dark mode text is 221,221,221.

@rxliuli

I’m not sure that a need for non-automated hyperlinks is that rare. It just depends on your use case.

It seems that Joplin will render text as a hyperlink if a text string is followed by a . and a known TLD. However py is the ccTLD for Paraguay but is also a very common extension for Python files, .pl is Poland but also used for Perl scripts etc. This is similar to @alexxnz situation where the note text coincidentally has a text.tld format and so is turned into a hyperlink.

So I would argue that it can be quite common for false URLs to get created.

Additionally there may be occasions where someone wants to note URLs but does not want them “live”, say, for researching or collating a malware / ad / tracker blocklist.

Personally I would consider it a benefit for Joplin to have a Note Settings option for hyperlinks to only be created when explicitly made using Markdown.

2 Likes

This is a very very general behavior change, and before standard markdown support (probably it will never be supported), joplin should not “modify” markdown rendering (not new, for example, the reference link of joplin is new), Otherwise, it will be inconsistent with the standard markdown, and the surrounding ecosystems are required to support this inconsistency (such as editors, website rendering, etc.)

I’m not suggesting they change the default behavior of auto-generating links. All I’m asking for is an option in the app so that I can opt-out of this behavior.

3 Likes

But in the cases described Joplin would not be modifying “standard markdown”.

This is a URL in markdown

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

and so is this

<https://example.com>

In markdown the below are just a pieces of text, no more.

https://example.com
example.com

However the render engine Joplin uses tries to be helpful and converts the pieces of text to URLs even though they are not declared using markdown as URLs.

So if there was an option to prevent this auto-creation of URLs it would mean that Joplin would actually be allowing users to better follow the “rules” of markdown, rather than break them as you suggest.


Markdown Guide - Links

3 Likes

Joplin has the ability to toggle soft breaks (which are part of standard markdown) because standard markdown is a bit at odds with how people typically want notes to render. I don’t see this request as much different, so there is definitely precedent to add a toggle.

image

1 Like

It might be a little convincing if you can find similar settings on other platforms or tools. . .

dpoulton via Joplin Forum <cozic@discoursemail.com> 于 2020年8月14日周五 上午4:40写道:

Just to be perfectly clear. The markdown-it engine has the option linkify set to false by default. Joplin sets this explicitly to true.

5 Likes

Why?

What other programs do is irrelevant to my point about what is and is not a hyperlink in a markdown document. You made the point that no changes should be made that cause Joplin to be “inconsisent with the standard markdown”. I was just pointing out a flaw in your argument, in that it is already inconsistent. Being able to toggle “linkify” off (thanks for clarifying linkify’s behaviour @tessus) would actually bring Joplin back to “standard markdown” when it comes to defining hyperlinks, not away from it.

1 Like

I can think of use cases where I do not want automatic link creation. One is where I use Joplin to store account information (encrypted, of course) and many (most) usernames are email addresses. Another one is when writing technical prose and I have example URLs for illustrative purposes only. I am sure there are others. But there is, in my opinion, a larger philosophical issue here… we all love Markdown for exactly the reasons we, relatively speaking, dislike Word and the like: It gets out of your way and lets you create content representing exactly what you want and nothing more. (No magic, don’t do me any favors, etc.) So yes, I support the OPs wish both pragmatically and conceptually. It would be great to have the option to disable this feature. I like Joplin and would like to see it stand out from the rest of the crowd. Thanks!

5 Likes