[Mediawiki-l] Special characters in URLs in templates

Morten Blaabjerg mortenblaabjerg at gmail.com
Tue Feb 22 10:49:56 UTC 2011


I use a quotation template in my wiki and for years it's been bugging me
that external links don't always show up as they should, when used within
templates. More often than not a simple {{{1}}} or {{{2}}} occur instead of
the expected external link.

Now it seems I've traced what seems to be the root of the problem.

A URL like this one :
http://web.archive.org/web/20061219205042/http://www.dis-danmark.dk/sydfyn/Historier/Amerika/rejsen_til_amerika.htm

works well : [
http://web.archive.org/web/20061219205042/http://www.dis-danmark.dk/sydfyn/Historier/Amerika/rejsen_til_amerika.htmsource]
shows up as a correct external link showcasing "source" highlighted
in light blue.

A URL like this one : http://www.dis-sydfyn.dk/viewpage.php?page_id=4

does not work : [http://www.dis-sydfyn.dk/viewpage.php?page_id=4 source]
shows simply as {{{2}}}

The differences in the two URLs are the use of the characters "?" and "=" in
the latter case. If these are replaced by "/" the external link is
highlighted, but of course won't lead one anywhere.

Case in question : http://notatwiki.dk/index.php?title=Rejsen_til_Amerika

The template itself is pretty straightforward. It uses to variables and
contains only this bit of HTML and MediaWiki markup :

<blockquote class="toccolours" style="line-height: 1.5em;">
<div style="text-align=left";>{{{1}}}</div>
<div style="text-align: right; font-style:normal;">{{{2}}}</div>
</blockquote>"

Any ideas for a remedy to make these URL's work in templates?

Raw links seem(!) to work regardless of what characters they contain, so the
problem seems related to the [ ] containment of the URL.

Yours Sincerely,
Morten Blaabjerg

--
Fri software (fri som i ytringsfrihed, ikke som i gratis) er efter min
mening et af de allervigtigste spørgsmål i vores tid.
Jeg støtter derfor Free Software Foundations arbejde for udbredelsen af fri
software : http://fsf.org/

Læs mere om hvorfor dette er så vigtigt her :
http://www.gnu.org/philosophy/why-free.html


More information about the MediaWiki-l mailing list