Bad URL parsing in the wiki when it ends with right-angle-bracket(greater-than mark).
|Assignee:||Jean-Baptiste Barth||% Done:|
When I write an URL and angle-bracket around the URL like below, the parsing is not correct. The bracket should not be included in the URL.
Refers to the RFC2396,
The angle-bracket "<" and ">" and double-quote (") characters are
excluded because they are often used as the delimiters around URI in
text documents and protocol fields.
#1 Updated by Jean-Baptiste Barth over 11 years ago
- Assignee set to Jean-Baptiste Barth
Thanks for reporting, I 100% agree..
When trying to look at this, I ran into the following problem :
Redmine::WikiFormatting::Textile::Formatter#inline_auto_link method runs after textile parsing, so it receives something like
http://www.redmine.org/> which is completely valid regarding the RFC.
If we don't want to do hacky things (and introduce a risk to not parse some valid urls correctly), we shoud change the way auto links are parsed : it should happen before textile, and they should be turned into standard textile links. But it can break so many things it should be heavily tested.
I'll try to investigate this tomorrow.
#2 Updated by Jean-Baptiste Barth over 11 years ago
Oops, my previous message was not so clear : "it receives something like
And it may not be valid regarding the RFC, but it at least only contains valid characters so it's difficult to parse it. We could find more problematic examples, like
http://www.example.net/?page=blah>, which would be textilized to
http://www.example.net/?page=blah>, then parse with redmine auto links...
#3 Updated by Minjie Zhu over 11 years ago
In our case, we often angle-bracket around a url if it is very long or contains some multi-byte chars. I think someone others may also have this issue.
Hope it will be fixed :)
Thanks for your investigation and I will also do some check for the redmine source, although I'm a beginner of rails :)
#4 Updated by Jean-Baptiste Barth about 11 years ago
- Status changed from New to Resolved
- Target version set to 1.0.3
- % Done changed from 0 to 100
- Affected version (unused) changed from devel to 1.0.2
- Resolution set to Fixed
- Affected version set to 1.0.2
I realized that
> shouldn't occur in the end of standard urls. Moreover wrapping links in angle brackets is a common practice, so we can introduce a specific case for that. Patch committed in r4287.