Roundup Tracker - Issues

Issue 2550664

classification
Improve handling of '>' when URLs are converted to links
Type: behavior Severity: normal
Components: Web interface Versions: 1.4
process
Status: closed
:
: richard : ezio.melotti, richard
Priority: normal : patch

Created on 2010-08-11 19:28 by ezio.melotti, last changed 2010-08-12 07:26 by ezio.melotti.

Files
File name Uploaded Description Edit Remove
gt.diff ezio.melotti, 2010-08-11 19:28 Patch to improve the handling of '>'.
Messages
msg4111 Author: [hidden] (ezio.melotti) Date: 2010-08-11 19:28
The current code in templating.py:StringHTMLProperty._hyper_repl_url
checks for a > *at the end* of the URL. If the url is e.g.
"<www.roundup.net>.":
 1) the string is first converted to "&lt;www.roundup.net&gt;.";
 2) the regex matches the whole string, including the trailing '.';
 3) _hyper_repl_url checks for a &gt; at the end of the string and
doesn't find it (because there's the dot);
 4) the whole string is converted to a link.

The attached patch checks for a &gt; in any point of the URL and convert
to a link only the part before it. It also refactors a bit the function
in order to apply the parentheses checks even when the &gt; is found and
improve it in case the ending ')' is missing.
msg4112 Author: [hidden] (ezio.melotti) Date: 2010-08-11 19:38
The example is wrong, the problem is only in the 'path' part of the url,
i.e. "<http://roundup.net/>.".
The patch is still valid.
msg4113 Author: [hidden] (richard) Date: 2010-08-12 04:59
Looks good to me, thanks!
msg4116 Author: [hidden] (ezio.melotti) Date: 2010-08-12 07:26
Thanks!
History
Date User Action Args
2010-08-12 07:26:36ezio.melottisetmessages: + msg4116
2010-08-12 04:59:58richardsetstatus: new -> closed
assignee: richard
messages: + msg4113
priority: normal
2010-08-11 19:38:04ezio.melottisetmessages: + msg4112
2010-08-11 19:28:16ezio.melotticreate