Correctly handle <abbr> followed by ISBN
[lhc/web/wiklou.git] / maintenance / parserTests.txt
index 264e207..aed2f05 100644 (file)
@@ -2021,21 +2021,6 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 </p>
 !! end
 
-!! test
-Magic Word: {{#PIPETRICK:}}
-!! options
-title=[[Some (page)]]
-!! input
-{{#pipetrick:Hello (one)}}
-{{#pipetrick:World, hi|}}
-{{#pipetrick:|Other}}
-!! result
-<p>Hello
-World
-Other (page)
-</p>
-!! end
-
 !! test
 Magic Word: {{REVISIONID}}
 !! input
@@ -3013,36 +2998,6 @@ pst
 [[:Bar:X (Y) Z|X (Y) Z]]
 !! end
 
-!! test
-pre-save transform: context links ("pipe trick") based on current page
-!! options
-pst
-!! input
-[[#section|]]
-[[#section (context)|]]
-[[/relative|]]
-[[../context/relative|]]
-[[../context/relative (extra)|]]
-!! result
-[[#section|section]]
-[[#section (context)|section]]
-[[/relative|relative]]
-[[../context/relative|relative]]
-[[../context/relative (extra)|relative]]
-!! end
-
-!! test
-pre-save transform: context links ("pipe trick") with full-width characters
-!! options
-pst
-!! input
-[[title, context|]]
-[[title (context)|]]
-!! result
-[[title, context|title]]
-[[title (context)|title]]
-!! end
-
 !! test
 pre-save transform: context links ("pipe trick") with interwiki prefix
 !! options
@@ -3157,65 +3112,6 @@ pst title=[[Ns:Somearticle (IGNORED), Context]]
 [[Ns:Article, Context|Article]]
 !! end
 
-!! test
-pre-save transform: context links ("pipe trick") with url escaped page names
-!! options
-pst
-!! input
-[[Hello wo%52ld|]]
-[[Hello wo%52ld (again)|]]
-!! result
-[[Hello wo%52ld|Hello woRld]]
-[[Hello wo%52ld (again)|Hello woRld]]
-!! end
-
-!! test
-pre-save transform: context links ("pipe trick") with variables are not pre-empted
-!! options
-pst title=[[Test (page)]]
-!! input
-[[{{{1|}}}|]]
-[[|{{{1|}}}]]
-[[{{subst:PAGENAME}}|]]
-!! result
-[[{{{1|}}}|]]
-[[|{{{1|}}}]]
-[[Test (page)|Test]]
-!! end
-
-!! article
-Template:pipetest
-!! text
-[[{{{1}}}|]]
-!! endarticle
-
-!! article
-Template:testpipe
-!! text
-[[|{{{1}}}]]
-!! endarticle
-
-!! test
-("pipe trick") should work outside PST
-!!options
-title=[[Help:hello (world)]]
-!! input 
-{{pipetest|hi (world)}}
-{{pipetest|hi (world), world}}
-{{pipetest|Help:hi (world), world}}
-{{pipetest|:Help:hi (world), world}}
-{{testpipe|hi}}
-[[{{PAGENAME}}|]]
-!! result
-<p><a href="/index.php?title=Hi_(world)&amp;action=edit&amp;redlink=1" class="new" title="Hi (world) (page does not exist)">hi</a>
-<a href="/index.php?title=Hi_(world),_world&amp;action=edit&amp;redlink=1" class="new" title="Hi (world), world (page does not exist)">hi</a>
-<a href="/index.php?title=Help:Hi_(world),_world&amp;action=edit&amp;redlink=1" class="new" title="Help:Hi (world), world (page does not exist)">hi</a>
-<a href="/index.php?title=Help:Hi_(world),_world&amp;action=edit&amp;redlink=1" class="new" title="Help:Hi (world), world (page does not exist)">hi</a>
-<a href="/index.php?title=Hi_(world)&amp;action=edit&amp;redlink=1" class="new" title="Hi (world) (page does not exist)">hi</a>
-<a href="/index.php?title=Hello_(world)&amp;action=edit&amp;redlink=1" class="new" title="Hello (world) (page does not exist)">Hello</a>
-</p>
-!! end
-
 
 ###
 ### Message transform tests
@@ -3270,6 +3166,16 @@ msg
 Special:RecentChanges
 !! end
 
+!! test
+{{#special:}} page name with subpage, known
+!! options
+msg
+!! input
+{{#special:Recentchanges/param}}
+!! result
+Special:RecentChanges/param
+!! end
+
 !! test
 {{#special:}} page name, unknown
 !! options
@@ -4542,6 +4448,23 @@ Table attribute safety
 
 !! end
 
+!! test
+CSS line continuation 1
+!! input
+<div style="background-image: u\&#10;rl(test.jpg);"></div>
+!! result
+<div></div>
+
+!! end
+
+!! test
+CSS line continuation 2
+!! input
+<div style="background-image: u\&#13;rl(test.jpg); "></div>
+!! result
+<div></div>
+
+!! end
 
 !! article
 Template:Identity
@@ -6438,6 +6361,97 @@ image4    |300px| centre
 
 !! end
 
+!! test
+Gallery (with options)
+!! input
+<gallery widths='60px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
+File:Nonexistant.jpg|caption
+File:Nonexistant.jpg
+image:foobar.jpg|some '''caption''' [[Main Page]]
+image:foobar.jpg
+</gallery>
+!! result
+<table class="gallery" cellspacing="0" cellpadding="0">
+       <caption>Foo <a href="/wiki/Main_Page" title="Main Page">Main Page</a></caption>
+       <tr>
+               <td><div class="gallerybox" style="width: 95px;">
+                       <div style="height: 52px;">Nonexistant.jpg</div>
+                       <div class="gallerytext">
+<p>caption
+</p>
+                       </div>
+               </div></td>
+               <td><div class="gallerybox" style="width: 95px;">
+                       <div style="height: 52px;">Nonexistant.jpg</div>
+                       <div class="gallerytext">
+                       </div>
+               </div></td>
+       </tr>
+       <tr>
+               <td><div class="gallerybox" style="width: 95px;">
+                       <div class="thumb" style="padding: 19px 0; width: 90px;"><div style="margin-left: auto; margin-right: auto; width: 60px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div>
+                       <div class="gallerytext">
+<p>some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+</p>
+                       </div>
+               </div></td>
+               <td><div class="gallerybox" style="width: 95px;">
+                       <div class="thumb" style="padding: 19px 0; width: 90px;"><div style="margin-left: auto; margin-right: auto; width: 60px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="60" height="7" /></a></div></div>
+                       <div class="gallerytext">
+                       </div>
+               </div></td>
+       </tr>
+</table>
+
+!! end
+
+!! test
+gallery (with showfilename option)
+!! input
+<gallery showfilename>
+File:Nonexistant.jpg|caption
+File:Nonexistant.jpg
+image:foobar.jpg|some '''caption''' [[Main Page]]
+File:Foobar.jpg
+</gallery>
+!! result
+<table class="gallery" cellspacing="0" cellpadding="0">
+       <tr>
+               <td><div class="gallerybox" style="width: 155px;">
+                       <div style="height: 152px;">Nonexistant.jpg</div>
+                       <div class="gallerytext">
+<p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
+caption
+</p>
+                       </div>
+               </div></td>
+               <td><div class="gallerybox" style="width: 155px;">
+                       <div style="height: 152px;">Nonexistant.jpg</div>
+                       <div class="gallerytext">
+<p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
+</p>
+                       </div>
+               </div></td>
+               <td><div class="gallerybox" style="width: 155px;">
+                       <div class="thumb" style="padding: 66px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
+some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+</p>
+                       </div>
+               </div></td>
+               <td><div class="gallerybox" style="width: 155px;">
+                       <div class="thumb" style="padding: 66px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+<p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
+</p>
+                       </div>
+               </div></td>
+       </tr>
+</table>
+
+!! end
+
 !! test
 HTML Hex character encoding (spells the word "JavaScript")
 !! input
@@ -6484,6 +6498,15 @@ ISBN ISBN 1234567890
 </p>
 !! end
 
+!! test
+Bug 22905: <abbr> followed by ISBN followed by </a>
+!! input
+<abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
+!! result
+<p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a href="http://www.example.com" class="external text" rel="nofollow">example.com</a>
+</p>
+!! end
+
 !! test
 Double RFC
 !! input
@@ -7738,6 +7761,143 @@ Bar foo
 </p>
 !! end
 
+!! test
+Verify that displaytitle works (bug #22501) no displaytitle
+!! options
+showtitle
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
+!! input
+this is not the the title
+!! result
+Parser test
+<p>this is not the the title
+</p>
+!! end
+
+!! test
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
+!! input
+this is not the the title
+{{DISPLAYTITLE:whatever}}
+!! result
+whatever
+<p>this is not the the title
+</p>
+!! end
+
+!! test
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
+!! input
+this is not the the title
+{{DISPLAYTITLE:whatever}}
+!! result
+Screen
+<p>this is not the the title
+</p>
+!! end
+
+!! test
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
+!! input
+this is not the the title
+{{DISPLAYTITLE:screen}}
+!! result
+screen
+<p>this is not the the title
+</p>
+!! end
+
+!! test
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
+!! input
+this is not the the title
+{{DISPLAYTITLE:screen}}
+!! result
+Screen
+<p>this is not the the title
+<a href="/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
+</p>
+!! end
+
+!! test
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
+!! input
+this is not the the title
+!! result
+Screen
+<p>this is not the the title
+</p>
+!! end
+!! test
+preload: check <noinclude> and <includeonly>
+!! options
+preload
+!! input
+Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
+!! result
+Hello kind world.
+!! end
+!! test
+preload: check <onlyinclude>
+!! options
+preload
+!! input
+Goodbye <onlyinclude>Hello world</onlyinclude>
+!! result
+Hello world
+!! end
+
+!! test
+preload: can pass tags through if we want to
+!! options
+preload
+!! input
+<includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
+!! result
+<includeonly>Hello world</includeonly>
+!! end
+
+!! test
+preload: check that it doesn't try to do tricks
+!! options
+preload
+!! input
+* <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
+!! result
+* <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
+!! end
 
 TODO:
 more images