Attention, hyperlinkers: inference of active text

Alexander Schmolck a.schmolck at gmx.net
Fri Jun 18 22:10:43 CEST 2004


claird at lairds.com (Cameron Laird) writes:

> I'm looking for ideas, although their expression in executable
> certainly doesn't offend me.
>
> I do text manipulation.  As it happens, I'm in a position to
> "activate" the obvious URI in
>   Now is the time for all good men to read http://www.ams.org/ 
> That's nice.  End-users "get it", and are happy I render
> "http://www.ams.org" as a hyperlink.  Most of them eventually
> notice the implications for punctuation, that is, that they're
> happier when they write
>   Look at http://bamboo.org !
> than
>   Look at http://bamboo.org!
>
> The design breaks down more annoyingly by the time we get to 
> the "file" scheme, though.  How do the rest of you handle this?
> Do you begin to make end-users quote, as in
>   The secret is in "file:\My Download Folder\dont_look.txt".
> ?  Is there some other obvious approach?  I am confident that
> requiring
>   It is on my drive as file:\Program%20Files\Perl\odysseus.exe 
> is NOT practical with my clients.

Can't you get them to write <URL:http://bamboo.org> (or, alternatively
<http://bamboo.org> which, although not backed up by a RFC, also ought to do
the job and is less to type and to remember).

Apart from making escaping superfuous, this should also solve all your
punctuation and linebreak problems robustly. '<','>' can't occur in URIs so
matching '<http:|file:|www\..*?>.' or so (and then kicking out '\n\s.*') ought
to work, no?

'as



More information about the Python-list mailing list