[Mailman-Users] Pipermail URL handling in archives

Mark Sapiro mark at msapiro.net
Fri Feb 22 22:03:39 CET 2008


Jim Popovitch wrote:
>
>I have a problem with some URLs being handled incorrectly.
>Specifically URLs that are at the end of a sentence followed by a
>period (full stop).   Example:
>
>   To enroll visit this site: http://www.domain.tld/cgi-bin/enroll.pl.
>
>Mailman/Pipermail converts that sentence like so:
>
>  To enroll visit this site: <A
>HREF="http://www.domain.tld/cgi-bin/enroll.pl.">http://www.domain.tld/cgi-bin/enroll.pl.</A>
>
>The ending period (full stop) then invalidates the URL.
>
>Is there any quick fix to 2.1.9 to resolve this?


You could try to find the line

urlpat = re.compile(r'(\w+://[^>)\s]+)') # URLs in text

near the beginning of Mailman/Archiver/HyperArch.py and change it to

urlpat = re.compile(r'(\w+://[^>)\s]+?)\.?(\s|$)') # URLs in text

Note this re is very lightly tested and may not work in all cases.

Of course, if you can get the posters to surround their URLs with <>,
there is no problem.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list