rgrove/sanitize — pull request #87 by heathd (2013-11-22 17:34:26+00:00)
Title: Allow anchor links containing colon

A colon is a legitimate character to contain in an ID reference in an
anchor link[1]. The REGEX_PROTOCOL was too general and would consider a
sequence such as '#foo:1' or '/somepage#foo:1' to define the '#foo'
protocol.

The '#' character is explicitly excluded from being part of URI
scheme[2]:

scheme = alpha *( alpha | digit | "+" | "-" | "." )

Therefore it seems safe to exclude the character from the initiali part of REGEX_PROTOCOL.

[1] http://www.w3.org/TR/html401/types.html#type-name
[2] http://www.ietf.org/rfc/rfc2396.txt