Difference between revisions of "Template:MediaWiki URL rules"

From Timelines
Jump to: navigation, search
(start)
 
(Other URI schemes do not necessarily require a plug-in)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
:URLs must begin with a supported [[URI scheme]]: <code>http://</code> and <code>https://</code> will be supported by all browsers; <code>irc://</code>, <code>ircs://</code>, <code>ftp://</code>, <code>news:</code>, <code>mailto:</code> and <code>gopher://</code> will require a plugin or an external application. IPv6 host-names are currently not supported.
+
:URLs must begin with a supported [[URI scheme]]. <code>http://</code> and <code>https://</code> will be supported by all browsers; however, <code>ftp://</code>, <code>gopher://</code>, <code>irc://</code>, <code>ircs://</code>, <code>mailto:</code> and <code>news:</code> may require a plug-in or an external application and should normally be avoided. [[IPv6]] host-names are currently not supported.
:URLs containing certain characters will display and link incorrectly unless those characters are encoded. For example, a space must be replaced by <code>%20</code>. To encode the URL, replace these characters:
+
:If URLs in citation template parameters contain certain characters, then they will not display and link correctly. Those characters need to be [[percent-encoded]]. For example, a space must be replaced by <code>%20</code>. To encode the URL, replace the following characters with:
 
{| class="wikitable" style="margin-left: 5em"
 
{| class="wikitable" style="margin-left: 5em"
! sp !! " !! , !! ' !! ; !! < !! > !! ? !! [ !! ] !! \ !! . !! : !! ! !! ? !! )
+
! sp !! " !! ' !! < !! > !! [ !! ] !! { !! <nowiki>|</nowiki> !! }
 
|-
 
|-
| %20 || %22 || %2c || %3a || %3b || %3c || %3e || %3f || %5b || %5d || %5c || %2e || %3a || %21 || %3f || %29
+
|| %20 || %22 || %27 || %3c || %3e || %5b || %5d || %7b || %7c || %7d
|}<noinclude>
+
|}
 +
:Single apostrophes do not need to be encoded; however, unencoded multiples will be parsed as italic or bold markup. Single curly closing braces also do not need to be encoded; however, an unencoded pair will be parsed as the double closing braces for the template transclusion.<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 09:07, 14 January 2016

URLs must begin with a supported URI scheme. http:// and https:// will be supported by all browsers; however, ftp://, gopher://, irc://, ircs://, mailto: and news: may require a plug-in or an external application and should normally be avoided. IPv6 host-names are currently not supported.
If URLs in citation template parameters contain certain characters, then they will not display and link correctly. Those characters need to be percent-encoded. For example, a space must be replaced by %20. To encode the URL, replace the following characters with:
sp " ' < > [ ] { | }
 %20  %22  %27  %3c  %3e  %5b  %5d  %7b  %7c  %7d
Single apostrophes do not need to be encoded; however, unencoded multiples will be parsed as italic or bold markup. Single curly closing braces also do not need to be encoded; however, an unencoded pair will be parsed as the double closing braces for the template transclusion.
Template documentation[create]