12

It is possible to write links without specifying the protocol, in this manner:

[This is a reference-style link][some-link]  
[This is an inline-style link](//stackexchange.com)

  [some-link]: //stackexchange.com

This is a reference-style link
This is an inline-style link

This gets inferred to https: just fine, and is a little trick that helps save a few characters when you're bumping up against the character limit with a lot of links in your post. To illustrate how this works, all text links I've used in this post do this.

However, today I noticed the following validation was triggering when I went to edit a post for Arqade's screenshot of the week Hall of Fame. This is a post with over 50 links, 25 of which are images:

All image URLs must start with https

It looks like extra validation now wraps the image links, forcing one to specify the protocol. To be clear: the Hall of Fame post CURRENTLY uses images without protocols: if you attempt to edit it, the validation now prevents you from submitting it until you add the protocol in.

This was not the case as recently as December 2023. Given the timing, it looks like this bug was introduced as part of the Imgur migration, which concluded in April 2024.

I think having the validation trigger when an image URL starts with http (or any other protocol like ftp) makes sense, but if text links can be inferred as https, I think image links should infer as well. In other words, the validation should not fail if the protocol is missing or removed.

6
  • 2
    That is a frustrating situation. However, I disagree with this proposal: protocol-relative links are generally a bad idea; they only made sense historically because some browsers would (inexplicably) display a warning if you loaded secure assets within an insecure website. If an asset is available over HTTPS, it should always be referred to by the full HTTPS URL, instead of adjusting the behavior based on context. For your specific case, I would suggest that you might be able to reclaim the necessary characters by using the shorter form https://arqade.com/u/1234 to link to users.
    – Jeremy
    Commented Aug 5 at 16:33
  • @Jeremy avoiding protocol-relative might've made sense 10-12 years ago, when the handshake could suffer from performance issues and https wasn't everywhere, but I wouldn't consider these issues major concerns in 2024. Especially as SE has gone https and only supports the last two versions of the mainline web and mobile browsers, which also enforce no mixed content anyway.
    – Robotnik
    Commented Aug 6 at 23:35
  • 2
    In either case, we can probably agree that the discrepancy between image links and regular links allowing or not allowing protocol relative should be resolved. Ultimately it's up to SE to decide how they wish to handle links moving forward.
    – Robotnik
    Commented Aug 6 at 23:37
  • 2
    This appears to be a recently-introduced bug. As an example, this 2022 edit that removed the https: from an image URL was allowed. Commented Aug 8 at 0:22
  • 1
    @Sonic - This Arqade Hall of Fame post has a revision from October 2023 which added a protocol-relative image (Rev 6 by Joachim). My guess is the image link validation changed alongside the imgur migration
    – Robotnik
    Commented Aug 8 at 0:35
  • 1
    Actually, even more recent: December 2023 (Rev 6). Note Rev 7 had to re-introduce the protocol to work around this bug
    – Robotnik
    Commented Aug 8 at 0:47

0

You must log in to answer this question.

Browse other questions tagged .