20 votes

Markdown/inline links don't work unless URL starts with http(s)

I figured I can't have been the first to notice this but I can't find any specific mention, and it still trips me up every so often.

If I want to link to Tildes, I can type
http://tildes.net,
https://tildes.net, or
www.tildes.net,

and they format automatically. Simply tildes.net (or blog.tildes.net) doesn't automatically turn into a link, which makes sense.

However, if I do inline links, only the first two will work:

Tildes (http), and
Tildes (https).

Tildes (www) results in Error 422 (Unprocessable Entity), topic_id36: String does not match expected pattern.
Tildes and Tildes (blog) do the same.

I saw the link canonicalization issue on GitLab but I don't know if this would fall under that.

6 comments

  1. [2]
    aphoenix
    (edited )
    Link
    What browser and OS are you using? Edit: actually, nevermind - I see what the issue is. In Markdown if you are creating a link using the markdown syntax, like so: [link text](link url) Then the...

    What browser and OS are you using?

    Edit: actually, nevermind - I see what the issue is. In Markdown if you are creating a link using the markdown syntax, like so:

    [link text](link url)
    

    Then the protocol is actually required, otherwise it will presume that you are creating a relative link.

    22 votes
    1. LetterCounter
      Link Parent
      I literally just had this happen in Obsidian. It even adds a nice feature that if the file doesnt exist yet in the vault, then clicking the relative link will actually create the file at that...

      I literally just had this happen in Obsidian. It even adds a nice feature that if the file doesnt exist yet in the vault, then clicking the relative link will actually create the file at that location the first time you click it.

      Learning new things!

      5 votes
  2. xk3
    Link
    Maybe relative links are less useful for this specific site but it's good hygiene anyways to always include the URL scheme. Markdown links on all other sites will very likely behave like this even...

    Maybe relative links are less useful for this specific site but it's good hygiene anyways to always include the URL scheme. Markdown links on all other sites will very likely behave like this even if there is a special fix on this site to convert relative markdown links into absolute ones.

    13 votes
  3. Trobador
    Link
    I am not familiar with any software or website that uses Markdown and lets you skip including the protocol in this manner, so it seems like intended behaviour to me. What if you want to link to a...

    I am not familiar with any software or website that uses Markdown and lets you skip including the protocol in this manner, so it seems like intended behaviour to me.

    What if you want to link to a different protocol like mailto?

    7 votes
  4. [2]
    em-dash
    Link
    Trivia: you actually can omit the protocol in an absolute URL, it just has syntax that'll look really weird to most people: //tildes.net for example It uses the protocol of the page you're already on.

    Trivia: you actually can omit the protocol in an absolute URL, it just has syntax that'll look really weird to most people: //tildes.net

    for example

    It uses the protocol of the page you're already on.

    1 vote
    1. Rudism
      Link Parent
      In my head I always thought of that syntax as still being a relative url--just relative up one level to the scheme instead of any part of the domain name.

      In my head I always thought of that syntax as still being a relative url--just relative up one level to the scheme instead of any part of the domain name.