Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

According to this answer:

We now encode any colons at position 7 or greater, which are not followed by 2 or more numbers.

Unfortunately this breaks links to URLs such as this one:

The link is rendered with the colons encoded and the result is:

According to this answer, colons are valid characters in hashtags and don't need to be encoded.

Observed in the wild here.

share|improve this question
up vote 3 down vote accepted

According to this answer, colons are valid characters in hashtags and don't need to be encoded. (In fact, % is not a valid character in a hashtag.)

I'm not sure we're looking at the same answer here – because what I'm seeing is that percent-encoding is just fine in the fragment.

This is a valid link to the answer:

– granted, IE8 doesn't handle it (I didn't try IE9), but Firefox, Chrome, Safari, and Opera all do the right thing.

Point being: Whether it's necessary or not, it's not illegal. A colon and %3a are semantically identical in URLs per the RFC.

It may be worth thinking about it, since some clients (including, I would assume, many hashbang-like JavaScript handlers) fail to handle it correctly, but your claim that we break the link is wrong.

share|improve this answer
Indeed, like your last paragraph kind of states, it's not only about the browser being able to scroll, but about JavaScript using the fragment for further processing. After clicking your encoded example, a simple javascript:alert(document.location.hash); shows the fragment will need some further processing then. But things like… (using %2d rather than the dashes) work fine here on SE. ;-) – Arjan Apr 24 '11 at 9:32
You're right, I misread the answer and % is valid (it's an unencoded % that's invalid). If I'm interpreting the rest correctly however, aren't unencoded colons allowed? – Brant Apr 24 '11 at 14:58

You must log in to answer this question.

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