Attention, hyperlinkers: inference of active text

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

claird at (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 
> That's nice.  End-users "get it", and are happy I render
> "" as a hyperlink.  Most of them eventually
> notice the implications for punctuation, that is, that they're
> happier when they write
>   Look at !
> than
>   Look at!
> 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:> (or, alternatively
<> 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?


More information about the Python-list mailing list