Opened 19 years ago
Closed 19 years ago
#1805 closed defect (invalid)
WikiFormatter/TracLinks escapes too much
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | wiki system | Version: | 0.8.4 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The WikiFormatter is a bit too enthusiastic about escaping URLs used in TracLinks — specifically, I wanted to create a TracLink to the head revision of a file, and so wrote [source:path/to/file.java?rev=head My Link Text] in the description for the new ticket I was entering. It got escaped, so that the link was to path/to/file.java%3Frev%3Dhead
instead. That URL yields a 404 error, not the head revision of path/to/file.java.
I have also noticed that it always escapes ampersands, even when they're the prefix to an HTML character entity. In other words, I should be able to write [ and get a left square bracket. But what I get instead is [.
About issue one: see TracLinks. You can use
[source:path/to/file.java#head My Link Text]
(i.e. the hash symbol) to link to a specific revision (or, as in this case, the latest revision).About the second issue: if this is the link appearing in the markup, then that's how it's supposed to be; unescaped ampersands are not allowed in XHTML (or HTML, for that matter). The browser should translate
&
to a normal ampersand when resolving the link. (However, if the ampersand is being escaped twice, that's a bug… feel free to reopen this ticket if that's the case).