Links written with the first character as a capital, e.g.
Http://stackoverflow.com
do not appear in a post, although they are shown in the preview. Here is a link that becomes invisible after submitting the post:
Links written with the first character as a capital, e.g.
Http://stackoverflow.com
do not appear in a post, although they are shown in the preview. Here is a link that becomes invisible after submitting the post:
Nice finding that bug.
For proof that it really is a bug, refer to RFC 3986, section 3.1 Scheme:
Although schemes are case- insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.
The comment-handling seems to work right.
I tested this in the MSE Formatting Sandbox first, but now that I can replicate it, it looks like any capital letter in the protocol section of a link created by specifying a bare URL in Markdown results in this behavior - disappearance of the link.
Here's a copy of what I tested, in case the sandbox answer is changed/updated.
Testing normal:
http://stackoverflow.com
Testing Http
Http://stackoverflow.com
Testing Https
Https://stackoverflow.com
Testing Ftp
Ftp://example.com
Testing a nonexistent protocol
DoesNotExist://example.com
DoesNotExist://example.com
Testing ALL CAPS:
HTTP://example.com
Testing rEVERSE cAPITALIZATION:
hTTP://www.example.com
Testing capital only in Domain:
http://Www.example.com
<
and >
.
There are two highly upvoted answers here that state "yes it is a bug" and a couple of downvoted ones that say "don't fix it".
I would like to offer this answer in favor of the "let's fix it" camp - and maybe to get a taly. We will see from the up/down votes what the community thinks. Consider this intended as a counterpoint to answers that say "don't fix it".
When someone includes a link in their answer that would be valid if copy/pasted into the address bar of their browser, it is reasonable to assume they intend it to be used as a link. While I understand that the current "link validator" may trip over the capitalization, I would like to see a change to the engine that allows the link - whether formatted with a [text](Http://link)
or directly as a Http://link
. It would be a very simple matter to return the protocol string as all lower case - no harder than rendering it invisible, for instance.
I see three possible approaches.
If you believe the current behavior is preferable, please downvote my answer. If you want either (2) or (3), indicate so by upvoting. A simple comment "prefer option 2" or "prefer option 3" would help (and that's exactly 15 characters...)
I don't buy the argument that "allowing unconventional capitalization will bring down the quality of the site". We have plenty of keen editors who will fix the occasionally mistyped protocol. My preference is for option 3 (but I can't upvote my own answer :-) )
Http
as a link. This is an added feature that I think should not be built.
http
etc. Again, I agree something should be done, just what should be done is the big question. And I stand by no-one knowing whether this is a bug or not other than devs, as per my new answer (FWIW). No need for apology, we're all just chewin' the fat ;)
In response to comments, and now an answer in response to my saying not to fix it.
I have said throughout that I don't disagree it "could" be a bug, just that only the developers can confirm this.
I also agreed somewhere that non lowercase http
simply not rendering is not practical or ideal at all.
The general consensus seems to be "This shouldn't be like this therefore it's a bug". And as it's allowed in the RFC Stack not allowing it is therefore a bug.
A bug is not "something which doesn't work how we believe it should work".
That's just something which could be "improved", including allowing mixed case http
because the RFC states it's permissible.
A bug is specifically "something which doesn't work how it was intended to work".
If a script for users to login doesn't allow users to login, there is a bug.
Users arguing "devs would not just allow non lowercase http
to not render" have not worked in a crazy/busy dev pit, "things" sometimes happen like this.
Perhaps it is a bug, and the devs shrugged their shoulders because it doesn't harm anything. Perhaps they already have it on a loooong todo list to sort one day.
Only they know their intentions etc.
It can be argued that because an RFC states mixed case http
is allowed, then a site such as Stack should allow it, given it's significant presence on the internet for technology based discussions etc.
However, I don't agree we should just because RFC states it's allowed.
I also see a good argument that Stack should set an example in having continuity in content, such as only allowing lower case http
, and not having messy looking hTtp
and other variants.
Profanities are a valid part of the English language, but they have no place on Stack.
Why ever not - they are in the dictionary, so therefore Stack should allow them.
No, Stack decides that even though profanities are a valid part of the language, it's offensive so they don't allow it.
Just as mixed case http
is in the RFC, but it's messy and looks poor.
We can make choices, and not allowing mixed case http
doesn't mean we're stating it is not correct, just the same as we're not stating profanities are not a part of the dictionary.
We're just making choices as to what we want to see on our site.
http
is acceptable, and looks better than mixed case, so why not enforce all lowercase to be clean looking?
[Please don't argue that it's entirely different because profanities are offensive whereas mixed case http is not. Of course that's true, but the entire point is both are valid yet we can choose not to allow them.]
So, discussion on the main issue here, and that is currently users text disappears without warning or notification, which is not fair and is quite confusing.
I do agree that non lowercase http
simply not rendering is not a good scenario. Users will wonder where their link went to, they might not even notice it.
And of course it could be the main part of the question or answer, and so they receive downvotes as a result of the Q or A being poor etc.
However, would you really be happy for posts around the site to look like this:
HTtp://stackoverflow.com
hTtP://stackoverflow.com
htTP://stackoverflow.com
+ others
Or, only ever allow:
http://stackoverflow.com
Personally, I think the mixed case ones look stupid, and Stack should promote clean looking URLs and have continuity throughout the site, not just conform to some RFC.
However, we do need to do something other than pretend the mixed case http
didn't exist.
So, I think the best solution would be for non lowercase http
to be automatically put in quoted text block.
Then the link is still there, users can see it's there but not rendering, and can edit the post to fix it.
Then we don't see HtTp
in the site as genuine links, which looks stupid and ugly.
Http:...
as a link is the moment when all other (ugly) forms start slipping in simply because they "work in the browser". There is something to be said for respecting consistency and convention. Thanks for giving some examples of how bad bad can get.
TL;DR: We should make the text visible, but it should not be a link. Instead, it should be plain text.
Apparently, the community feels very strongly that this is an issue worth fixing. My original answer said that it wasn't much of a problem and that we should ignore the behavior for the sake of having correctly formed URLs in posts. But after ~20 downvotes and a hoard of negative comments, I am willing to retract that opinion for the sake of the community.
However, I--and I'm sure quite a few others--still strongly believe that we should not treat Http:
as if it were a properly formed protocol. It is simply incorrect by convention and accepting it will only encourage people to use the incorrect form in posts. Also, it opens the door for all other variations of the protocol such as HTTP:
, hTTp:
, etc. While this is not horrible, it still brings down the quality of the posts on our site (and makes us look like we don't know what a protocol is ;)
Therefore, I offer a compromise: we should change the behavior so that the text is visible in the post, but we should not make it a valid link. Instead, it should be rendered as plain text.
In defense of this proposal, I have four points to make:
I refer you to @rgettman's answer and how DoesNotExist://example.com
renders as plain text in the post. Just as DoesNotExist:
is not treated as valid protocol, so Http:
should be likewise ignored.
By making the Http:
text visible, we stop people from including hidden spam in posts as well as circumventing the character limit for posts (@MartinSmith's answer is a prime example of this last point). At the same time, by not making it a valid link, we encourage users to edit Http:
to the correct http:
form so that their links work as intended.
This proposal does not interfere with the author's intent in any way by auto-correcting the links. Instead, it posts exactly what the author types. And if they want it to be a real link, all they need to do is edit H
to h
, which takes little more than a second.
I've said this before, but we cannot allow Http:
as a valid protocol because then hTTp:
and all other incorrect forms should likewise be allowed by the same logic. And then, why not also allow people to omit the http:
altogether and just post www.site.com or even just site.com?. As you can see, there is really no end to this. If we make more than one valid way to render links, then we will soon have dozens of ways to render links.
Limiting users to just one correct form keeps things consistent and easy to manage.
As for comments allowing Http:
, I do not think that that is a valid argument because comments are 2nd-class citizens. You can't really compare them with questions and answers. Just because comments allow incorrectly formed URLs does not mean we should transfer this behavior to the important posts. Also, typing comments is a very rapid action, which means typos are natural in comments. Questions and answers though should be written with care and quality.
In summary, I see this as being the best of both worlds. We eliminate all the problems with the invisible text as well as prevent people from using Http:
as if it were correct.
Http:
as a correctly written protocol. It is simply incorrect. And I don't see why the site should have to compensate for people thinking it is correct. Making the text visible is fine, but treating Http:...
as equal to http:...
is a design flaw. A bug if you will. ;) It does not make the site more intuitive or user-friendly. Instead, it trashes convention, allows ugly and incorrect URLs, and makes the code for rendering links all the more complex since we now have to account for every possible variation of every possible protocol.
Http:
but not say HTTP:
is arbitrary. Why is one incorrect form acceptable but not the other incorrect form? But I respect your opinion. Besides, it's not like you or I have any say over what happens anyways since only the SE devs themselves can make the final decision. We'll just have to wait and see. In the meantime, have a nice holiday season. :)
http
is acceptable, and nor do I care what any RFC states. I've yet to see any feasible solution - even Jay deleted his answer with a proposed idea...
Http
is a correctly formed protocol! The site has plenty of editors willing to fix typos when they are them - but the can't see the invisible link. I don't buy the argument that allowing legal links would bring down the quality of SE. There are more important things to worry about.
Http
is correct in the same sense that hTTp
is. Meaning, they will work if you happen to type them into a browser (browsers are often smart enough to lowercase it for you), but they are still incorrectly formed by convention. I'd be fine if SO was willing to auto-lowercase Http
like browsers do, but that interferes with the author's post too much. So, I am against allowing Http
as a link for the sake of having proper URLs.
Http:...
but what about hTTp:...
or HTTp:
or even no protocol (www.site.com
as I said in my post). Do you see what I mean? We cannot allow just Http
and ignore all other forms because that is arbitrary. If we allow one, we will sooner or later allow them all.
http://
in many address bars, that doesn't make it a valid link; but a server will respond correctly to the request hTtP://...
. I argue that "if it is valid, allow it". If it bothers you that this is "ugly", then the simple tweak to take the (valid) protocol string and render it as all lower case would be a very simple piece of code. But I believe the current status is a bug, not a feature. That's just an opinion, not a fact.
Http
a link.
Http
text to be plain text and not a link.