[Tracker-discuss] [issue127] not properly htmlizing links

Georg Brandl metatracker at psf.upfronthosting.co.za
Thu Aug 9 11:13:23 CEST 2007


Georg Brandl added the comment:

Martin v. Löwis schrieb:
> Martin v. Löwis added the comment:
> 
> This doesn't have to be fixed before the switch, as the markup is not in the
> database, but is added during rendering.
> 
> To fix it, templating.py:StringHTMLProperty.hyper_re needs to be fixed. It
> currently reads
> 
>     hyper_re = re.compile(r'((?P<url>\w{3,6}://\S+)|'
>                           r'(?P<email>[-+=%/\w\.]+@[\w\.\-]+)|'
>                           r'(?P<item>(?P<class>[A-Za-z_]+)(\s*)(?P<id>\d+)))')
> 
> I think changing that to
> 
>     hyper_re = re.compile(r'((?P<url>\w{3,6}://\S+[\w/])|'
>                           r'(?P<email>[-+=%/\w\.]+@[\w\.\-]+)|'
>                           r'(?P<item>(?P<class>[A-Za-z_]+)(\s*)(?P<id>\d+)))')
> 
> should do the trick, i.e. requiring that an URL ends with a letter, digit,
> underscore or slash.

While you're at it, could you please make the last line
   r'(?P<item>(?P<class>[A-Za-z_]+|#)(\s*)(?P<id>\d+)))'

(and default "class" to "issue") to resolve #103 too?

Georg

_______________________________________________________
Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue127>
_______________________________________________________


More information about the Tracker-discuss mailing list