Attention, hyperlinkers: inference of active text

Andrew Clover and-google at doxdesk.com
Mon Jun 21 06:23:28 CEST 2004


Cameron Laird <claird at lairds.com> wrote:

> The design breaks down more annoyingly by the time we get to 
> the "file" scheme, though. How do the rest of you handle this?

The file scheme is no different to http regarding punctuation.
Personally, I trim characters that are valid in URIs but not likely to
be at the end, such as '.', from the end of URIs, so that constructs
like "See http://www.foo.com/index.html." still work. It's a hack but
the results seem reasonable.

>   It is on my drive as file:\Program Files\Perl\odysseus.exe 

URIs with spaces and backslashes are not valid at all, and will break
browsers. (Also the example is missing the drive letter.)

If inputting file names directly is a requirement I would suggest
having a different format for it that doesn't involve escaping-to-URI,
for example you could sniff for double-quoted strings starting with
'[drive letter]:\'.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the Python-list mailing list