This might need a better function name.  Couldn't think of a good one that encompassed exactly what this function does, which is that it makes sure that any partial or complete URI an end user manually enters into the editor matches the hint list as best it can and doesn't make decodeURI() throw an exception.

A percent sign could be literal ("100% cool.html"), or it could be part of a percent-encoded character ("%20" space character), or it could be a Unicode character encoding ("%C3%A7" ç character).  Users will rarely be manually typing percent-encoded characters into the editor, so I used a fairly simple heuristic that performs adequately enough.