Mailing List Archive

Spaces in local file links
Skipped content of type multipart/alternative
Spaces in local file links [ In reply to ]
> Hey Folks,
>
> I'm sure this has been addressed somewhere before, but:
>
> [file://c:\test directory\test.doc TEST]
>
> in a Wiki page doesn't handle the space in the directory name
> properly. Putting %20 instead of the space fixes the output, but the
> actual link becomes
> C:\test%20directory\test.doc and doesn't work in Explorer.
>
> Is this an Explorer problem I'm fighting here or a Wiki limitation on
> handling spaces in links?

The Wiki considers the space to be the delimiter between the link URL
and the link text. Since a space isn't really a valid character for the
URL, I think this is a reasonable choice for a delimiter. Trac doesn't
manipulate the URL, so the issue is how IE is choosing to interpret the
URL. I believe the issue may be due to the direction of the slashes.
Try replacing the backslashes with forward slashes. I think IE assumes
you mean to interpret the path literally if you use backslashes, but
does the URL conversion if you use forward slashes.

Of course I'm a bit surprised you're trying to link to local files. I
guess you must be the only developer?

--
Matthew Good <trac@matt-good.net>
Spaces in local file links [ In reply to ]
Thanks for response. Forward slashes didn't help right away,
unfortunately, but I finally found a solution. What I was really doing
before was linking to files on my company's internal server mapped to a
local drive letter. So, I tried the server name instead of the local
drive letter, and everything worked out fine with %20 inserted.

We use Trac on an intranet server to publish various project files such
as specs, design docs etc, and many of them are located on other servers
inside directories with spaces in their names.

\Mike


-----Original Message-----
From: trac-bounces@lists.edgewall.com
[mailto:trac-bounces@lists.edgewall.com] On Behalf Of Matthew Good
Sent: Tuesday, September 28, 2004 8:50 PM
To: Trac Mailing List
Subject: Re: [Trac] Spaces in local file links

> Hey Folks,
>
> I'm sure this has been addressed somewhere before, but:
>
> [file://c:\test directory\test.doc TEST]
>
> in a Wiki page doesn't handle the space in the directory name
> properly. Putting %20 instead of the space fixes the output, but the
> actual link becomes C:\test%20directory\test.doc and doesn't work in
> Explorer.
>
> Is this an Explorer problem I'm fighting here or a Wiki limitation on
> handling spaces in links?

The Wiki considers the space to be the delimiter between the link URL
and the link text. Since a space isn't really a valid character for the
URL, I think this is a reasonable choice for a delimiter. Trac doesn't
manipulate the URL, so the issue is how IE is choosing to interpret the
URL. I believe the issue may be due to the direction of the slashes.
Try replacing the backslashes with forward slashes. I think IE assumes
you mean to interpret the path literally if you use backslashes, but
does the URL conversion if you use forward slashes.

Of course I'm a bit surprised you're trying to link to local files. I
guess you must be the only developer?

--
Matthew Good <trac@matt-good.net>

_______________________________________________
Trac mailing list
Trac@lists.edgewall.com
http://lists.edgewall.com/mailman/listinfo/trac