Two new parser tests related to bug 6200
[lhc/web/wiklou.git] / maintenance / parserTests.txt
index 49ceba2..12a2cd1 100644 (file)
@@ -370,6 +370,21 @@ Regression with preformatted in <center>
 
 !! end
 
+# Expected output in the following test is not really expected (there should be
+# <pre> in the output) -- it's only testing for well-formedness.
+!! test
+Bug 6200: Preformatted in <blockquote>
+!! input
+<blockquote>
+ Blah
+</blockquote>
+!! result
+<blockquote>
+ Blah
+</blockquote>
+
+!! end
+
 !! test
 <pre> with attributes (bug 3202)
 !! input
@@ -1013,6 +1028,15 @@ External link containing double-single-quotes in text embedded in italics (bug 4
 </p>
 !! end
 
+!! test
+External link containing double-single-quotes with no space separating the url from text in italics
+!! input
+[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
+!! result
+<p><a href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm" class="external text" rel="nofollow"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
+</p>
+!! end
+
 !! test
 URL-encoding in URL functions (single parameter)
 !! input
@@ -1124,10 +1148,12 @@ Simple table
 !! result
 <table>
 <tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
 </td></tr>
 <tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
 </td></tr></table>
 
 !! end
@@ -1160,27 +1186,45 @@ Multiplication table
 <caption>Multiplication table
 </caption>
 <tr>
-<th> &times; </th><th> 1 </th><th> 2 </th><th> 3
+<th> &times; </th>
+<th> 1 </th>
+<th> 2 </th>
+<th> 3
 </th></tr>
 <tr>
 <th> 1
-</th><td> 1 </td><td> 2 </td><td> 3
+</th>
+<td> 1 </td>
+<td> 2 </td>
+<td> 3
 </td></tr>
 <tr>
 <th> 2
-</th><td> 2 </td><td> 4 </td><td> 6
+</th>
+<td> 2 </td>
+<td> 4 </td>
+<td> 6
 </td></tr>
 <tr>
 <th> 3
-</th><td> 3 </td><td> 6 </td><td> 9
+</th>
+<td> 3 </td>
+<td> 6 </td>
+<td> 9
 </td></tr>
 <tr>
 <th> 4
-</th><td> 4 </td><td> 8 </td><td> 12
+</th>
+<td> 4 </td>
+<td> 8 </td>
+<td> 12
 </td></tr>
 <tr>
 <th> 5
-</th><td> 5 </td><td> 10 </td><td> 15
+</th>
+<td> 5 </td>
+<td> 10 </td>
+<td> 15
 </td></tr></table>
 
 !! end
@@ -1200,12 +1244,15 @@ Table rowspan
 <table align="right" border="1">
 <tr>
 <td> Cell 1, row 1
-</td><td rowspan="2"> Cell 2, row 1 (and 2)
-</td><td> Cell 3, row 1
+</td>
+<td rowspan="2"> Cell 2, row 1 (and 2)
+</td>
+<td> Cell 3, row 1
 </td></tr>
 <tr>
 <td> Cell 1, row 2
-</td><td> Cell 3, row 2
+</td>
+<td> Cell 3, row 2
 </td></tr></table>
 
 !! end
@@ -1227,7 +1274,8 @@ Nested table
 <table border="1">
 <tr>
 <td> &alpha;
-</td><td>
+</td>
+<td>
 <table bgcolor="#ABCDEF" border="2">
 <tr>
 <td>nested
@@ -1235,7 +1283,8 @@ Nested table
 <tr>
 <td>table
 </td></tr></table>
-</td><td>the original table again
+</td>
+<td>the original table again
 </td></tr></table>
 
 !! end
@@ -1255,20 +1304,16 @@ Invalid attributes in table cell (bug 1830)
 !! end
 
 
-# FIXME: It's not clear at all that this is the result we want, but the actual
-# output right now is invalid XML, so clearly something is wrong.  The result
-# specified here is now valid XML, which is an improvement . . .
 !! test
 Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
-!! options
-disabled
 !! input
 {|
 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
 !! result
 <table>
 <tr>
-<td><a href="ftp://|x||" class="external autonumber" title="ftp://|x||" rel="nofollow">[1]</a></td><td>" onmouseover="alert(document.cookie)"&gt;test
+<td>[<a href="ftp://%7Cx" class="external free" rel="nofollow">ftp://%7Cx</a></td>
+<td>]" onmouseover="alert(document.cookie)"&gt;test
 </td>
 </tr>
 </table>
@@ -1462,12 +1507,10 @@ Link containing "<#" and ">#" as a hex sequences
 
 !! test
 Link containing double-single-quotes '' (bug 4598)
-!! options
-disabled
 !! input
 [[Lista d''e paise d''o munno]]
 !! result
-<p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit" class="new" title="Lista d''e paise d''o munno">Lista d''e paise d''o munno</a>
+<p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
 </p>
 !! end
 
@@ -1485,7 +1528,25 @@ Link containing double-single-quotes '' in text embedded in italics (bug 4598 sa
 !! input
 ''Some [[Link|pretty ''italics'' and stuff]]!
 !! result
-<p><i>Some </i><a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
+<p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
+</p>
+!! end
+
+!! test
+Link with double quotes in title part (literal) and alternate part (interpreted)
+!! input
+[[File:Denys Savchenko ''Pentecoste''.jpg]]
+
+[[''Pentecoste'']]
+
+[[''Pentecoste''|Pentecoste]]
+
+[[''Pentecoste''|''Pentecoste'']]
+!! result
+<p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
+</p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
+</p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
+</p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)"><i>Pentecoste</i></a>
 </p>
 !! end
 
@@ -1969,15 +2030,6 @@ title=[[User:Ævar Arnfjörð Bjarmason]]
 </p>
 !! end
 
-!! test
-Magic Word: {{NUMBEROFARTICLES}}
-!! input
-{{NUMBEROFARTICLES}}
-!! result
-<p>2
-</p>
-!! end
-
 !! test
 Magic Word: {{NUMBEROFFILES}}
 !! input
@@ -2551,10 +2603,12 @@ foo {{table}}
 </p>
 <table>
 <tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
 </td></tr>
 <tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
 </td></tr></table>
 
 !! end
@@ -2569,10 +2623,12 @@ foo
 </p>
 <table>
 <tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
 </td></tr>
 <tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
 </td></tr></table>
 
 !! end
@@ -3273,7 +3329,14 @@ Image with link parameter (URL target) and unnamed parameter
 </p>
 !! end
 
+!! test
+Thumbnail image with link parameter
+!! input
+[[Image:foobar.jpg|thumb|link=http://example.com/|Title]]
+!! result
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="http://example.com/"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Title</div></div></div>
 
+!! end
 
 !! test
 Image with frame and link
@@ -5157,7 +5220,10 @@ noxml
 !! result
 <table>
 <tr>
-<th>https://</th><th></th><th></th><th>
+<th>https://</th>
+<th></th>
+<th></th>
+<th>
 </td>
 </tr>
 </table>
@@ -5174,7 +5240,8 @@ Fuzz testing: Parser21
 <table>
 <tr>
 <th> <a href="irc://{{ftp://a" class="external free" rel="nofollow">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
-</th><td>
+</th>
+<td>
 </td>
 </tr>
 </table>
@@ -6992,6 +7059,29 @@ __NOEDITSECTION__
 </p>
 !! end
 
+# Expected output in the following test is not necessarily expected (there
+# should probably be <p> tags inside the <blockquote> in the output) -- it's
+# only testing for well-formedness.
+!! test
+Bug 6200: blockquotes and paragraph formatting
+!! input
+<blockquote>
+foo
+</blockquote>
+
+bar
+
+ baz
+!! result
+<blockquote>
+foo
+</blockquote>
+<p>bar
+</p>
+<pre>baz
+</pre>
+!! end
+
 !! test
 Bug 8293: Use of center tag ruins paragraph formatting
 !! input
@@ -7226,6 +7316,20 @@ China
 </p>
 !! end
 
+!! test
+Bug 24072: more test on conversion rule for title
+!! options
+language=zh variant=zh-tw showtitle
+!! input
+This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
+This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
+!! result
+Taiwan
+<p>This should be stripped!
+This won't take interferes with the title rule.
+</p>
+!! end
+
 !! test
 Raw output of variant escape tags (R flag)
 !! options
 </p>
 <table>
 <tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
 </td></tr>
 <tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
 </td></tr></table>
 <p>y
 </p>