-31

I would like to have links like:

  1. [Google](google.com) to render as [Google](http://google.com) and [Google Drive](drive.google.com) as [Google Drive](http://drive.google.com)

  2. [Google]s(google.com) to render as [Google](https://google.com) and [Google Drive]s(drive.google.com) as [Google Drive](https://drive.google.com)

The s probably stands for 'secure'.

20
  • Why not? Is there already such a feature or an easier way? Commented Jun 30, 2022 at 14:21
  • 9
    You would need to explain why? The embed links 'feature' is markdown syntax for any link. Why have this special case for https? What if you actually want to type a plural with a link? Also as https is pretty much standardized, why support HTTP at all?
    – Suraj Rao
    Commented Jun 30, 2022 at 14:24
  • 1
    @SurajRao, if you want to type a plural, it'd be [Google](google.com)s -> [Google](https://google.com)s. Commented Jun 30, 2022 at 14:26
  • 14
    Can't you just put the http/https bit in the url? Why is additional syntax needed?
    – Kevin B
    Commented Jun 30, 2022 at 14:27
  • Just a shorter way, maybe? Commented Jun 30, 2022 at 14:29
  • Also, typing the colon and slashes in http:// and https:// is a pain. Commented Jun 30, 2022 at 14:31
  • 4
    I'm usually just copy-pasting links, any way...
    – Cerbrus
    Commented Jun 30, 2022 at 14:32
  • 2
    Note that SE uses CommonMark as the flavor, and it has its defined specs such as inline links.
    – Andrew T.
    Commented Jun 30, 2022 at 14:34
  • 4
    If you are really opposed to including http you could do [Google](//google.com); which'll take you to https://google.com (https because SO is https; // means it would use the same protocol that you are using for the current site).
    – Thom A
    Commented Jun 30, 2022 at 14:35
  • 3
    If you want http, you can type http
    – Kevin B
    Commented Jun 30, 2022 at 14:38
  • 14
    Imagine the amount of protocols you could've typed out instead of typing out this question and all these comments...
    – Cerbrus
    Commented Jun 30, 2022 at 14:39
  • 2
    You would have to put http://, @TheAmateurCoder , but not many sites aren't https any more (many reroute http to https)
    – Thom A
    Commented Jun 30, 2022 at 14:43
  • 1
    Workaround: Let the browser expand it: Ctrl + T, Ctrl + V, Enter, F6, Ctrl + C (with google.com in the clipboard, replaced by https://www.google.com/). This was tested in Firefox. Commented Jun 30, 2022 at 16:19
  • 2
    I'd sort of like request #1 simply because it would mean that I could fit more links to sites other than the one I'm flagging on in a flag...or SE could just increase the max comment flag length like we've asked for for years ;-) Then again, it'd really only buy you two characters per link due to protocol-relative URIs and the fact that basically every site supports HTTPS. Overall, probably not worth the trouble.
    – Ryan M Mod
    Commented Jun 30, 2022 at 19:02
  • 3
    It's unclear to me what you're asking for here. Are you looking for specific special cases for google.com and drive.google.com because you type these a lot, or are you looking for Stack Overflow to deviate from how Markdown works everywhere else in the world and invent our own link syntax?
    – user229044 Mod
    Commented Jun 30, 2022 at 19:23

2 Answers 2

6

You're barking up the wrong tree.

We, nor the developers of Stack Overflow get to set or change the markdown specifications. You need to start at Common Mark. From there you can find the current Links spec.

You want to suggest a feature request against the Common Mark specification first and once that got accepted and released, you can ask here on Meta for the developers to upgrade their current markdown parser and renderer to the latest specs.

2

That's not how HTML works.

The protocol is required because otherwise, the rendered HTML wouldn't know if the URL is relative or absolute.

Since the protocol is required any way, there's no point in writing:

[Google]s(http://google.com)

Instead of:

[Google](https://google.com)

9
  • Dang, minus 2. Are we forgetting that this MD is pretty naively parsed into HTML?
    – Cerbrus
    Commented Jun 30, 2022 at 14:31
  • 2
    "It's done this way due to the way it is written" to a question literally asking for it to be changed is kinda weird. surely there's better reasoning than it works the way it works because that's how it works
    – Kevin B
    Commented Jun 30, 2022 at 14:33
  • 2
    This is more of a "It's done this way because the way you're asking for can't work"... The MD parser would have to assume all urls are absolute. In SO's case, that's probably right, but I wouldn't be surprised if there's at least some relative urls out there.
    – Cerbrus
    Commented Jun 30, 2022 at 14:34
  • 2
    it... can, though. markdown conversion to html is done with code, which very well could be changed to make it work the way they're requesting.. it'd just break a lot of existing links in the process while not adding any new functionality... all to save 4-5 keystrokes per link when most links are copy-pasted anyway.
    – Kevin B
    Commented Jun 30, 2022 at 14:36
  • @KevinB, No, as we cannot assume all urls are absolute.
    – Cerbrus
    Commented Jun 30, 2022 at 14:37
  • 1
    that's not an unsolvable problem
    – Kevin B
    Commented Jun 30, 2022 at 14:39
  • 1
    That's technically correct, but I don't think that invalidates my answer @KevinB :D
    – Cerbrus
    Commented Jun 30, 2022 at 14:40
  • @KevinB, how would it "just break a lot of existing links in the process", LOL? Commented Jun 30, 2022 at 14:44
  • 1
    @TheAmateurCoder It may or may not break a lot of existing links. But you're changing the way billions of existing words are interpreted. It's not as simple as just introducing a new syntax, all existing text has to be vetted against this change. Regardless, it's not a suggestion that anybody seriously thinks will go ahead. It doesn't solve a real problem that anybody has, at the cost of producing a custom markdown implementation that is not compatible with the rest of the world.
    – user229044 Mod
    Commented Jun 30, 2022 at 20:39

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