4

I was retagging Run a shell script with an html button and got a following message when trying to save changes:

Links cannot contain 'mywebsite' (try a full domain or wrap it in a code block).

Here's how it looks. You can see the problematic link too, notice that it's not a markdown-formatted link but just a plain-text URL.

Screenshot of the error message.

mywebsite was already there before I edited it, so I guess the feature that prevents using it has been implemented in the last two years. I couldn't find any information why is using it actually prohibited.

Sometimes it's useful to reference an abstract site like mywebsite. example.com can be used - that's what I did to save that edit, but mywebsite seemed to fit much better, referring specifically to that website, not some website like example.com does. localhost is too specific, implying that the server is running on the same machine, which is not necessarily true.

I think revealing actual URL of the website usually isn't necessary. Sometimes websites being covered in the question don't even have an URL because they are tested locally. The tip in the error message doesn't seem helpful too and can teach users bad formatting habits. (Why can't I use it? Why wrap it in a code block if it's not a code?)

Questions.

  • Why is mywebsite disallowed?
  • Why are code blocks an exception? Are there any other allowed formatting contexts that aren't mentioned in the error message? (quote blocks?)
  • Why not disallow example.com except for code blocks?
  • What about localhost or 127.0.0.1?
1
  • 1
    Note that the relevant RFC specifically allows *.example, so mywebsite.example is just as good as example.com.
    – MSalters
    Commented Jul 29, 2013 at 14:14

1 Answer 1

6

Why is mywebsite disallowed?

To prevent users from creating broken links. Text that looks like a valid link will be auto-linked by the parser, but links such as those containing mywebsite have probably become rather popular on Stack Overflow, which would now link to non-existing domains or 404.

Not sure if that causes any impact in the search relevance of Stack Exchange pages, but it's certainly not a nice user experience to have broken links on the site.

I'm also not sure if mywebsite specifically is blacklisted, or if it's just an altogether invalid URL that is not allowed. Probably the latter.

Why are code blocks an exception?

Code blocks are not subject to auto-linking.

Are there any other allowed formatting contexts that aren't mentioned in the error message? (quote blocks?)

No, only inlined code (with <code> or backticks), or preformatted code (with <pre> or four-space indentation) are ignored when parsing for links.

Why not disallow example.com except for code blocks?

example.com was explicitly specified in RFC 2606 as the URL to be used for examples.

What about localhost or 127.0.0.1?

Again, if these were linked they'd obviously point to the wrong location if clicked—the reader's machine, and not what the OP intended.

but mywebsite seemed to fit much better, referring specifically to that website, not some website like example.com does

If the OP explains that it's their own website they are talking about, that shouldn't be a problem.

2
  • Thanks for your answer, it made a few things clearer to me. Still, both mywebsite and localhost will produce broken links, so will example.com (even if it's allowed by RFC, these links won't make any use). Shouldn't all those just be ignored by the parser? Is posting localhost links interrupted too?
    – gronostaj
    Commented Jul 26, 2013 at 18:21
  • Any link to example.com is—both semantically and in terms of how it behaves when clicked by the user—a valid link, that's why they are allowed. Try going to http://example.com/foo/bar/baz. mywebsite will not always produce a broken link. For example, http://mysite/ is not a valid URL, but http://mysite.com is and shouldn't be blocked. localhost on the other hand is always "not valid" for SE.
    – slhck
    Commented Jul 26, 2013 at 18:34

You must log in to answer this question.

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