Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index e627b44..bcdbe8c 100644 (file)
@@ -59,6 +59,12 @@ MediaWiki:bad image list
 * [[File:Bad.jpg]] except [[Nasty page]]
 !!endarticle
 
+!! article
+Template:inner list
+!! text
+* item 1
+!! endarticle
+
 ###
 ### Basic tests
 ###
@@ -634,6 +640,17 @@ Definition and unordered list using wiki syntax nested in unordered list using h
 
 !! end
 
+!! test
+Definition list with empty definition and following paragraph
+!! input
+; term:
+Paragraph text
+!! result
+<dl><dt> term</dt><dd>
+</dd></dl>
+<p>Paragraph text
+</p>
+!! end
 
 ###
 ### External links
@@ -2147,6 +2164,36 @@ List items are not parsed correctly following a <pre> block (bug 785)
 
 !! end
 
+!! test
+List items from template
+!! input
+
+{{inner list}}
+* item 2
+
+* item 0
+{{inner list}}
+* item 2
+
+* item 0
+* notSOL{{inner list}}
+* item 2
+!! result
+<ul><li> item 1
+</li><li> item 2
+</li></ul>
+<ul><li> item 0
+</li><li> item 1
+</li><li> item 2
+</li></ul>
+<ul><li> item 0
+</li><li> notSOL
+</li><li> item 1
+</li><li> item 2
+</li></ul>
+
+!! end
+
 ###
 ### Magic Words
 ###
@@ -3677,6 +3724,36 @@ msg
 No such special page
 !! end
 
+!! test
+{{#speciale:}} page name, known
+!! options
+msg
+!! input
+{{#speciale:Recentchanges}}
+!! result
+Special:RecentChanges
+!! end
+
+!! test
+{{#speciale:}} page name with subpage, known
+!! options
+msg
+!! input
+{{#speciale:Recentchanges/param}}
+!! result
+Special:RecentChanges/param
+!! end
+
+!! test
+{{#speciale:}} page name, unknown
+!! options
+msg
+!! input
+{{#speciale:foobarnonexistent}}
+!! result
+No_such_special_page
+!! end
+
 ###
 ### Images
 ###
@@ -5998,8 +6075,6 @@ Special page transclusion
 !! input
 {{Special:Prefixindex/Xyzzyx}}
 !! result
-<p><br />
-</p>
 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end
@@ -6011,11 +6086,7 @@ Special page transclusion twice (bug 5021)
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
 !! result
-<p><br />
-</p>
 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
-<p><br />
-</p>
 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end
@@ -9205,6 +9276,90 @@ new support for bdi element (bug 31817)
 
 !!end
 
+!! test
+Ignore pipe between table row attributes
+!! input
+{|
+| quux
+|- id=foo | style='color: red'
+| bar
+|}
+!! result
+<table>
+<tr>
+<td> quux
+</td></tr>
+<tr id="foo" style="color: red">
+<td> bar
+</td></tr></table>
+
+!! end
+
+!!test
+Gallery override link with WikiLink (bug 34852)
+!! input
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
+</gallery>
+!! result
+<ul class="gallery">
+               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+<p>caption
+</p>
+                       </div>
+               </div></li>
+</ul>
+
+!! end
+
+!!test
+Gallery override link with absolute external link (bug 34852)
+!! input
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
+</gallery>
+!! result
+<ul class="gallery">
+               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+<p>caption
+</p>
+                       </div>
+               </div></li>
+</ul>
+
+!! end
+
+!!test
+Gallery override link with malicious javascript (bug 34852)
+!! input
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
+</gallery>
+!! result
+<ul class="gallery">
+               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
+                       <div class="gallerytext">
+<p>caption
+</p>
+                       </div>
+               </div></li>
+</ul>
+
+!! end
+
+!!test
+Language parser function
+!! input
+{{#language:ar}}
+!! result
+<p>العربية
+</p>
+!! end
 
 TODO:
 more images