Jump to content

Template:URL/testcases

From Wikipedia, the free encyclopedia
{{URL}}
TemplateSandbox
{{URL|example.com|optional display text}} {{URL|example.com|optional display text}}
{{URL| http:// }}
TemplateSandbox
[http:// ]
<span class="url">[http:// ]</span>
[http:// ]
<span class="url">[http:// ]</span>
{{URL| example.com }}
TemplateSandbox
example.com
<span class="url">[http://example.com example<wbr/>.com]</span>
example.com
<span class="url">[http://example.com example<wbr/>.com]</span>
{{URL| EXAMPLE.COM }}
TemplateSandbox
example.com
<span class="url">[http://EXAMPLE.COM example<wbr/>.com]</span>
example.com
<span class="url">[http://EXAMPLE.COM example<wbr/>.com]</span>
{{URL| www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| WWW.EXAMPLE.COM }}
TemplateSandbox
www.example.com
<span class="url">[http://WWW.EXAMPLE.COM www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://WWW.EXAMPLE.COM www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| https://www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[https://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[https://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com/ }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
{{URL| https://www.EXAMPLE.cOm }}
TemplateSandbox
www.example.com
<span class="url">[https://www.EXAMPLE.cOm www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[https://www.EXAMPLE.cOm www<wbr/>.example<wbr/>.com]</span>
{{URL| HTTPS://www.EXAMPLE.cOm/ }}
TemplateSandbox
www.example.com
<span class="url">[HTTPS://www.EXAMPLE.cOm/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[HTTPS://www.EXAMPLE.cOm/ www<wbr/>.example<wbr/>.com]</span>
{{URL| https://www.example.com/ }}
TemplateSandbox
www.example.com
<span class="url">[https://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[https://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
{{URL| http://example.com }}
TemplateSandbox
example.com
<span class="url">[http://example.com example<wbr/>.com]</span>
example.com
<span class="url">[http://example.com example<wbr/>.com]</span>
{{URL| https://example.com }}
TemplateSandbox
example.com
<span class="url">[https://example.com example<wbr/>.com]</span>
example.com
<span class="url">[https://example.com example<wbr/>.com]</span>
{{URL| ftp://example.com }}
TemplateSandbox
example.com
<span class="url">[ftp://example.com example<wbr/>.com]</span>
example.com
<span class="url">[ftp://example.com example<wbr/>.com]</span>
{{URL| ftp://www.example.com/ }}
TemplateSandbox
www.example.com
<span class="url">[ftp://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[ftp://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com/foo/bar }}
TemplateSandbox
www.example.com/foo/bar
<span class="url">[http://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
www.example.com/foo/bar
<span class="url">[http://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| http://www.example.com/foo/bar/ }}
TemplateSandbox
www.example.com/foo/bar/
<span class="url">[http://www.example.com/foo/bar/ www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar<wbr/>/]</span>
www.example.com/foo/bar/
<span class="url">[http://www.example.com/foo/bar/ www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar<wbr/>/]</span>
{{URL| http://www.example.com/foO/BaR }}
TemplateSandbox
www.example.com/foO/BaR
<span class="url">[http://www.example.com/foO/BaR www<wbr/>.example<wbr/>.com<wbr/>/foO<wbr/>/BaR]</span>
www.example.com/foO/BaR
<span class="url">[http://www.example.com/foO/BaR www<wbr/>.example<wbr/>.com<wbr/>/foO<wbr/>/BaR]</span>
{{URL| https://www.example.com/foo/bar }}
TemplateSandbox
www.example.com/foo/bar
<span class="url">[https://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
www.example.com/foo/bar
<span class="url">[https://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| http://example.com/foo/bar }}
TemplateSandbox
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| https://example.com/foo/bar }}
TemplateSandbox
example.com/foo/bar
<span class="url">[https://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
example.com/foo/bar
<span class="url">[https://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| example.com/foo/bar }}
TemplateSandbox
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| www.example.com/foo/bar }}
TemplateSandbox
www.example.com/foo/bar
<span class="url">[http://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
www.example.com/foo/bar
<span class="url">[http://www.example.com/foo/bar www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL| http://example.com/foo/bar | }}
TemplateSandbox
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
example.com/foo/bar
<span class="url">[http://example.com/foo/bar example<wbr/>.com<wbr/>/foo<wbr/>/bar]</span>
{{URL|1=http://www.example.com?foo=BaR}}
TemplateSandbox
www.example.com?foo=BaR
<span class="url">[http://www.example.com?foo=BaR www<wbr/>.example<wbr/>.com?foo=BaR]</span>
www.example.com?foo=BaR
<span class="url">[http://www.example.com?foo=BaR www<wbr/>.example<wbr/>.com?foo=BaR]</span>
{{URL| http://www.example.com#fooBaR }}
TemplateSandbox
www.example.com#fooBaR
<span class="url">[http://www.example.com#fooBaR www<wbr/>.example<wbr/>.com<wbr/>#fooBaR]</span>
www.example.com#fooBaR
<span class="url">[http://www.example.com#fooBaR www<wbr/>.example<wbr/>.com<wbr/>#fooBaR]</span>
{{URL| http://www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com:8080 }}
TemplateSandbox
www.example.com:8080
<span class="url">[http://www.example.com:8080 www<wbr/>.example<wbr/>.com:8080]</span>
www.example.com:8080
<span class="url">[http://www.example.com:8080 www<wbr/>.example<wbr/>.com:8080]</span>
{{URL| http://www.example.com:8080/foo/bar }}
TemplateSandbox
www.example.com:8080/foo/bar
<span class="url">[http://www.example.com:8080/foo/bar www<wbr/>.example<wbr/>.com:8080<wbr/>/foo<wbr/>/bar]</span>
www.example.com:8080/foo/bar
<span class="url">[http://www.example.com:8080/foo/bar www<wbr/>.example<wbr/>.com:8080<wbr/>/foo<wbr/>/bar]</span>
{{URL| www.example.com:8080 }}
TemplateSandbox
www.example.com:8080
<span class="url">[http://www.example.com:8080 www<wbr/>.example<wbr/>.com:8080]</span>
www.example.com:8080
<span class="url">[http://www.example.com:8080 www<wbr/>.example<wbr/>.com:8080]</span>
{{URL| www.example.com:8080/foo/bar }}
TemplateSandbox
www.example.com:8080/foo/bar
<span class="url">[http://www.example.com:8080/foo/bar www<wbr/>.example<wbr/>.com:8080<wbr/>/foo<wbr/>/bar]</span>
www.example.com:8080/foo/bar
<span class="url">[http://www.example.com:8080/foo/bar www<wbr/>.example<wbr/>.com:8080<wbr/>/foo<wbr/>/bar]</span>
{{URL| http://www.example.com/foo bar }}
TemplateSandbox
www.example.com/foo%20bar
<span class="url">[http://www.example.com/foo%20bar www<wbr/>.example<wbr/>.com<wbr/>/foo%20bar]</span>
www.example.com/foo%20bar
<span class="url">[http://www.example.com/foo%20bar www<wbr/>.example<wbr/>.com<wbr/>/foo%20bar]</span>
{{URL| www.example.com/foo bar }}
TemplateSandbox
www.example.com/foo%20bar
<span class="url">[http://www.example.com/foo%20bar www<wbr/>.example<wbr/>.com<wbr/>/foo%20bar]</span>
www.example.com/foo%20bar
<span class="url">[http://www.example.com/foo%20bar www<wbr/>.example<wbr/>.com<wbr/>/foo%20bar]</span>
{{URL| http://example.com/foo/bar | link }}
TemplateSandbox
link
<span class="url">[http://example.com/foo/bar link]</span>
link
<span class="url">[http://example.com/foo/bar link]</span>
{{URL| https://example.com/foo/bar | link }}
TemplateSandbox
link
<span class="url">[https://example.com/foo/bar link]</span>
link
<span class="url">[https://example.com/foo/bar link]</span>
{{URL| example.com/foo/bar | link }}
TemplateSandbox
link
<span class="url">[http://example.com/foo/bar link]</span>
link
<span class="url">[http://example.com/foo/bar link]</span>
{{URL| www.example.com/foo/bar | link }}
TemplateSandbox
link
<span class="url">[http://www.example.com/foo/bar link]</span>
link
<span class="url">[http://www.example.com/foo/bar link]</span>
{{URL| www.example.com/foo/bar | 捦挺挎 }}
TemplateSandbox
捦挺挎
<span class="url">[http://www.example.com/foo/bar 捦挺挎]</span>
捦挺挎
<span class="url">[http://www.example.com/foo/bar 捦挺挎]</span>
{{URL| www.example.com/foo/捦挺挎/bar | link }}
TemplateSandbox
link
<span class="url">[http://www.example.com/foo/捦挺挎/bar link]</span>
link
<span class="url">[http://www.example.com/foo/捦挺挎/bar link]</span>
{{URL| عمان.icom.museum }}
TemplateSandbox
عمان.icom.museum
<span class="url">[http://عمان.icom.museum عمان<wbr/>.icom<wbr/>.museum]</span>
عمان.icom.museum
<span class="url">[http://عمان.icom.museum عمان<wbr/>.icom<wbr/>.museum]</span>
{{URL| http://عمان.icom.museum }}
TemplateSandbox
عمان.icom.museum
<span class="url">[http://عمان.icom.museum عمان<wbr/>.icom<wbr/>.museum]</span>
عمان.icom.museum
<span class="url">[http://عمان.icom.museum عمان<wbr/>.icom<wbr/>.museum]</span>
{{URL| 1964thetribute.com }}
TemplateSandbox
1964thetribute.com
<span class="url">[http://1964thetribute.com 1964thetribute<wbr/>.com]</span>
1964thetribute.com
<span class="url">[http://1964thetribute.com 1964thetribute<wbr/>.com]</span>
{{URL| 1964thetribute.com | 1964thetribute.com }}
TemplateSandbox
1964thetribute.com
<span class="url">[http://1964thetribute.com 1964thetribute.com]</span>
1964thetribute.com
<span class="url">[http://1964thetribute.com 1964thetribute.com]</span>
{{URL|http://www.example.com/foo/bar?a=b&c=d}}
{{URL| http:www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| http:/www.example.com }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com/# }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example.com/? }}
TemplateSandbox
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
www.example.com
<span class="url">[http://www.example.com/ www<wbr/>.example<wbr/>.com]</span>
{{URL| http://www.example1.com<br>http://www.example2.com }}
TemplateSandbox

http://www.example2.com http://www.example1.com
http://www.example2.com
<span class="url">[http://www.example1.com<br>http://www.example2.com http://www.example1.com<br>http://www.example2.com]</span>

http://www.example2.com http://www.example1.com
http://www.example2.com
<span class="url">[http://www.example1.com<br>http://www.example2.com http://www.example1.com<br>http://www.example2.com]</span>
{{URL| http://www.example1.com and http://www.example2.com/ }}
TemplateSandbox
http://www.example1.com%20and%20http://www.example2.com/
<span class="url">[http://www.example1.com%20and%20http://www.example2.com/ http://www.example1.com%20and%20http://www.example2.com/]</span>
http://www.example1.com%20and%20http://www.example2.com/
<span class="url">[http://www.example1.com%20and%20http://www.example2.com/ http://www.example1.com%20and%20http://www.example2.com/]</span>
{{URL|1=http://www.example.com/foo/bar?a=b&c=d}}
TemplateSandbox
www.example.com/foo/bar?a=b&c=d
<span class="url">[http://www.example.com/foo/bar?a=b&c=d www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar?a=b&c=d]</span>
www.example.com/foo/bar?a=b&c=d
<span class="url">[http://www.example.com/foo/bar?a=b&c=d www<wbr/>.example<wbr/>.com<wbr/>/foo<wbr/>/bar?a=b&c=d]</span>
{{URL|2=example.com}}
TemplateSandbox
example.com
example.com
example.com
example.com
{{URL|2=http://example.com/foo}}
TemplateSandbox
http://example.com/foo
http://example.com/foo
http://example.com/foo
http://example.com/foo
{{URL| http://www.example.com | example }}
TemplateSandbox
example
<span class="url">[http://www.example.com example]</span>
example
<span class="url">[http://www.example.com example]</span>
{{URL| 1=http://www.sho.com/site/dexter/home.sho| 2=''Dexter''{{'}}s official website}}
TemplateSandbox
Dexter's official website
<span class="url">[http://www.sho.com/site/dexter/home.sho ''Dexter''<span class="nowrap" style="padding-left:0.1em;">&#39;</span>s official website]</span>
Dexter's official website
<span class="url">[http://www.sho.com/site/dexter/home.sho ''Dexter''<span class="nowrap" style="padding-left:0.1em;">&#39;</span>s official website]</span>

Warning examples

[edit]

If the URL may contain equal signs, the parameters should be numbered explicitly to have the template work as expected (otherwise, parameter value overrides may occur) ; this is more problematic when an explicit display text is provided in parameter 2.

There's absolutely never any problem when the parameter 2 is explicitly passed, but in this case, using this template is not even needed, and standard Wiki link syntax will be fully equivalent and in fact simpler to edit and faster to compute on the server.

Code Result Sandbox Result
{{URL| http://www.ex=ample.com}} www.ex=ample.com www.ex=ample.com
{{URL| http://www.ex=ample.com | example }} example example
{{URL| 1=http://www.ex=ample.com | 2=example }} example example


Word wrapping test

[edit]
Code Result Sandbox Result Manual invokation
{{URL| 1=www.adobe.com/devnet/pdf/pdf_reference_archive.html}} www.adobe.com/devnet/pdf/pdf_reference_archive.html www.adobe.com/devnet/pdf/pdf_reference_archive.html www.adobe.com/devnet/pdf/pdf_reference_archive.html
{{URL| 1=http://en.m.wikipedia.org/w/index.php?title=User:Codename_Lisa/sandbox&oldid=636147649}} en.m.wikipedia.org/w/index.php?title=User%3ACodename_Lisa%2Fsandbox&oldid=636147649 en.m.wikipedia.org/w/index.php?title=User%3ACodename_Lisa%2Fsandbox&oldid=636147649 en.m.wikipedia.org/w/index.php?title=User%3ACodename_Lisa%2Fsandbox&oldid=636147649
{{URL| 1=http://windows.microsoft.com/en-us/windows/turn-off-computer-faq#1TC=windows-vista}} windows.microsoft.com/en-us/windows/turn-off-computer-faq#1TC=windows-vista windows.microsoft.com/en-us/windows/turn-off-computer-faq#1TC=windows-vista windows.microsoft.com/en-us/windows/turn-off-computer-faq#1TC=windows-vista
{{URL| 1=http://vvv.some_domain_name.local/some_folder_name/yet.another.foldername/some-other-folder-name/}} vvv.some_domain_name.local/some_folder_name/yet.another.foldername/some-other-folder-name/ vvv.some_domain_name.local/some_folder_name/yet.another.foldername/some-other-folder-name/ vvv.some_domain_name.local/some_folder_name/yet.another.foldername/some-other-folder-name/
{{URL| 1=http://www.example.com/?some+request+with+plus+in+it}} www.example.com?some+request+with+plus+in+it www.example.com?some+request+with+plus+in+it www.example.com?some+request+with+plus+in+it
Code Result Sandbox Result Manual invokation
{{URL| 1=http://www.example.com |2=Supercalifragilistic__expialidocious}} Supercalifragilistic__expialidocious Supercalifragilistic__expialidocious Supercalifragilistic__expialidocious
{{URL| 1=http://www.example.com |2=Supercalifragilistic//expialidocious}} Supercalifragilistic//expialidocious Supercalifragilistic//expialidocious Supercalifragilistic//expialidocious
{{URL| 1=http://www.example.com |2=Supercalifragilistic..expialidocious}} Supercalifragilistic..expialidocious Supercalifragilistic..expialidocious Supercalifragilistic..expialidocious
{{URL| 1=http://www.example.com |2=Supercalifragilistic##expialidocious}} Supercalifragilistic##expialidocious Supercalifragilistic##expialidocious Supercalifragilistic##expialidocious