0

Sometimes people post local web server or arbitrary non-existent example URLs as reference to their issue. In those cases it should be possible to avoid the auto-linking of them.

I know that you can do that by using backticks as described in an answer to "How to avoid the creation of automatic links?", though this also formats the URL as code, which it isn't and which makes their display different to linked URLs.

I was told about a second solution, which is using a numeric character reference for one slash like this:

https://someexamplewebsite.com => https://someexamplewebsite.google.com

This works as expected for questions and answers, but it doesn't work in comments and is rather a hack.

It would be better if the used markdown syntax could be extended, so that people can escape the URL somehow to avoid the auto-linking, e.g. by preceding it with a backslash or enclosing it in curly braces or something similar.

Examples where this would be needed:

11
  • "though this also formats the URL as code (which it isn't)." Why is that a bad thing? Can you provide us with an example where a url really shouldn't be formatted as code, nor as url?
    – Cerbrus
    Oct 14, 2016 at 9:02
  • You can also just omit the http:// and it will not be auto parsed. Oct 14, 2016 at 9:08
  • 1
    @Cerbrus: When the URL is not part of the code, it is semantically wrong to format it that way. Only code should be formatted that way. Oct 14, 2016 at 9:10
  • @SebastianZartner: Is it that bad to format it in a code block? What semantically correct way would you suggest to mark a url so it won't be formatted?
    – Cerbrus
    Oct 14, 2016 at 9:14
  • @ShadowWizard: Correct, but then it may not be recognized as URL in some cases. Oct 14, 2016 at 9:14
  • The correct way would probably be to not format them at all, as they are neither code nor links, i.e. they'd not be enclosed by tags. Oct 14, 2016 at 9:27
  • @SebastianZartner: That's not what I'm asking. How would you tell markdown not to format an url?
    – Cerbrus
    Oct 14, 2016 at 9:27
  • I already provided some suggestions in my question. I think a good solution would be to prefix it with a backslash, like e.g. \someexamplewebsite.google.com. Oct 14, 2016 at 9:46
  • I've added some use cases where I believe it's worth being able to escape URLs. Oct 14, 2016 at 10:13
  • For the last 2 links, code blocks are perfectly valid. The first one can't be edited without actually making the question invalid, but there, code blocks would suffice too. It's all sample data.
    – Cerbrus
    Oct 14, 2016 at 10:17
  • 1
    Turns out this was already asked before, using almost same wording. /cc @Cerbrus Oct 14, 2016 at 17:54

1 Answer 1

1

I disagree with this request.

You state that urls shouldn't be formatted as code, because they're not code.
Semantically, that may be correct, but if the url isn't part of a Q/A's code, and it shouldn't be formatted as an url, the url probably shouldn't be in there in the first place.

When we're talking semantics, your request would require an addition to be made to markdown that tells the interpreter: "Yes, this is an url, but don't display it as an url".
Semantically, that doesn't seem right.

I'm also pretty sure the markdown for that would be longer than the / workaround, and it wouldn't work in comments.

2
  • "your request would require an addition to be made to markdown that tells the interpreter: "Yes, this is an url, but don't display it as an url"". It would actually tell the interpreter: "This is an escaped part, only remove the escape characters, but otherwise don't do anything special with it." Oct 14, 2016 at 9:59
  • "the markdown for that would be longer than the / workaround, and it wouldn't work in comments." As I said, it may simply be escaped by prepending a backslash or surrounded by curly braces or something like that, which is shorter than / and looks less hacky. Oct 14, 2016 at 10:16

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