Hi,
I just wanted to quickly say a big thanks to everyone for their suggestions.
I decided to implement an extension so I could have
<file>c:\path\to\file.doc</file>. It's simple and effective, and very user
friendly.
MediaWiki is awesome, and now I can see why. These projects have such a
capable and helpful developer base.
Thanks again!
Michael.
From: Carlos <angus(a)quovadis.com.ar>
Reply-To: Wikimedia developers <wikitech-l(a)lists.wikimedia.org>
To: Wikimedia developers <wikitech-l(a)lists.wikimedia.org>
Subject: Re: [Wikitech-l] Using spaces in file urls
Date: Fri, 02 Feb 2007 10:44:17 +0100
Michael . wrote:
[...]
I've gotten far enough with this using meta and
mediawiki.org, and have
enabled file:// links and a bunch of other stuff to make this posisble,
even
changing the browsers so file:// links are
supported from the site. The
only
problem I've got left is what to do when
there's a space in the file or
directory name being linked to.
For example, if a file is stored in p:\docs\some user documentation.doc,
I
can't link to it in the wiki without setting
$wgRawHtml and using the a
href=... tag directly inside html tags. Not a very secure option, and
also
not very user-friendly. Substituting spaces for
%20 doesn't work (IE
renders
the %20 directly for file:// links, it seems),
and using [blah] doesn't
work, becuase the first space gets regarded as the split between the url
and
the title of the link to be displayed. And an a
href tag just gets
ignored,
despite my efforts to try and add it to the
attribute whitelist.
I've been messing around for options for a few days now, and I've broken
and
unbroken everything a few times, by screwing with
stuff like
Sanitize.php,
Linker.php, Parser.php, and so on. But despite
being a long-term PHP
developer, I can't figure this code out despite my best efforts.
So I'd like to ask the community if they have any suggestions on how I
can
achieve this? None of the code changes I made
seemed to have any effect,
so
I'm at a loss as to what to do next.
Maybe you can create a simple markup extension, which transforms
something like '<mylink href="file://p:\docs\a b
c">Link</mylink>' into
'<a href="file://p:\docs\a b c">Link</a>' (or what the
correct HTML
should be).
These extensions are very easy to build. The documentation is here:
http://meta.wikimedia.org/wiki/Extending_wiki_markup
Good luck.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/wikitech-l