I've gone and done something naughty. I've just bumped $wgVersion
[lhc/web/wiklou.git] / maintenance / parserTests.txt
index fedbb85..7656f45 100644 (file)
@@ -116,7 +116,7 @@ Italics and bold
 </li><li> plain<b><i>bold-italic</i>bold</b>plain
 </li><li> plain<i>italic<b>bold-italic</b></i>plain
 </li><li> plain<b>bold<i>bold-italic</i></b>plain
-</li><li> plain l&#39;<i>italic</i>plain
+</li><li> plain l'<i>italic</i>plain
 </li><li> plain l'<b>bold</b> plain
 </li></ul>
 
@@ -864,18 +864,6 @@ BUG 289: literal double quote in bracketed URL
 </p>
 !!end
 
-!! test
-External links: invalid character
-Fixme: the missing char seems to have gone missing
-!! options
-disabled
-!! input
-[http://www.example.com  test]
-!! result
-<p>[<a href="http://www.example.com" class="external free" rel="nofollow">http://www.example.com</a>  test]
-</p>
-!! end
-
 !! test
 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
 !! input
@@ -1526,7 +1514,7 @@ Piped link to URL
 !! input
 Piped link to URL: [[http://www.example.com|an example URL]]
 !! result
-<p>Piped link to URL: [<a href="http://www.example.com|an" class="external text" rel="nofollow">example URL</a>]
+<p>Piped link to URL: [<a href="http://www.example.com%7Can" class="external text" rel="nofollow">example URL</a>]
 </p>
 !! end
 
@@ -2177,6 +2165,21 @@ language=de
 !! end
 
 
+!! test
+Urlencode
+!! input
+{{urlencode:hi world?!}}
+{{urlencode:hi world?!|WIKI}}
+{{urlencode:hi world?!|PATH}}
+{{urlencode:hi world?!|QUERY}}
+!! result
+<p>hi+world%3F%21
+hi_world%3F!
+hi%20world%3F%21
+hi+world%3F%21
+</p>
+!! end
+
 ###
 ### Magic links
 ###
@@ -2588,7 +2591,7 @@ BUG 41: Template parameters shown as broken links
 Template:MSGNW test
 !! text
 ''None'' of '''this''' should be 
-* interepreted
+* interpreted
  but rather passed unmodified
 {{test}}
 !! endarticle
@@ -2602,7 +2605,7 @@ disabled
 {{msgnw:MSGNW test}}
 !! result
 <p>''None'' of '''this''' should be 
-* interepreted
+* interpreted
  but rather passed unmodified
 {{test}}
 </p>
@@ -2932,6 +2935,46 @@ pst
 Foo
 !! end
 
+!! article
+Template:SubstTest
+!!text
+{{<includeonly>subst:</includeonly>Includes}}
+!! endarticle
+
+!! article
+Template:SafeSubstTest
+!! text
+{{<includeonly>safesubst:</includeonly>Includes}}
+!! endarticle
+
+!! test
+bug 22297: safesubst: works during PST
+!! options
+pst
+!! input
+{{subst:SafeSubstTest}}{{safesubst:SubstTest}}
+!! result
+FoobarFoobar
+!! end
+
+!! test
+bug 22297: safesubst: works during normal parse
+!! input
+{{SafeSubstTest}}
+!! result
+<p>Foobar
+</p>
+!! end
+
+!! test:
+subst: does not work during normal parse
+!! input
+{{SubstTest}}
+!! result
+<p>{{subst:Includes}}
+</p>
+!! end
+
 !! test
 pre-save transform: context links ("pipe trick")
 !! options
@@ -3126,6 +3169,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
@@ -3269,6 +3322,15 @@ Add test with existing image page
 </p>
 !! end
 
+!! test
+bug 18784  Link to non-existent image page with caption should use caption as link text
+!! input
+[[:Image:test|caption]]
+!! result
+<p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
+</p>
+!! end
+
 !! test
 Frameless image caption with a free URL
 !! input
@@ -3283,7 +3345,7 @@ Thumbnail image caption with a free URL
 !! input
 [[Image:foobar.jpg|thumb|http://example.com]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 
 !! end
 
@@ -3292,7 +3354,7 @@ Thumbnail image caption with a free URL and explicit alt
 !! input
 [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" 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><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 
 !! end
 
@@ -3301,7 +3363,7 @@ BUG 1887: A ISBN with a thumbnail
 !! input
 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
 
 !! end
 
@@ -3310,7 +3372,7 @@ BUG 1887: A RFC with a thumbnail
 !! input
 [[Image:foobar.jpg|thumb|This is RFC 12354]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>This is <a href="http://tools.ietf.org/html/rfc12354" class="external mw-magiclink-rfc">RFC 12354</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>This is <a href="http://tools.ietf.org/html/rfc12354" class="external mw-magiclink-rfc">RFC 12354</a></div></div></div>
 
 !! end
 
@@ -3319,7 +3381,7 @@ BUG 1887: A mailto link with a thumbnail
 !! input
 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>Please <a href="mailto:nobody@example.com" class="external free" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>Please <a href="mailto:nobody@example.com" class="external free" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
 
 !! end
 
@@ -3329,7 +3391,7 @@ so math is not stripped and turns up as escaped &lt;math&gt; tags.
 !! input
 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
 
 !! end
 
@@ -3340,7 +3402,7 @@ math
 !! input
 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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><span class="texhtml">2 + 2</span></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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><span class="texhtml">2 + 2</span></div></div></div>
 
 !! end
 
@@ -3413,7 +3475,7 @@ Image caption containing another image
 !! input
 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>This is a caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">File:Icon.png</a> inside it!</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>This is a caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
 
 !! end
 
@@ -3433,7 +3495,7 @@ Bug 3090: External links other than http: in image captions
 !! input
 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" 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>This caption has <a href="irc://example.net" class="external text" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" rel="nofollow">Secure</a> ext links in it.</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="200" height="23" 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>This caption has <a href="irc://example.net" class="external text" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" rel="nofollow">Secure</a> ext links in it.</div></div></div>
 
 !! end
 
@@ -4055,6 +4117,31 @@ Character reference normalization in link text (bug 1938)
 </p>
 !!end
 
+!! article
+אַ
+!! text
+Test for unicode normalization
+
+The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E
+!! endarticle
+
+!! test
+(bug 19451) Links should refer to the normalized form.
+!! input
+[[&#xFB2E;]]
+[[&#x5d0;&#x5b7;]]
+[[&#x5d0;ַ]]
+[[א&#x5b7;]]
+[[אַ]]
+!! result
+<p><a href="/wiki/%D7%90%D6%B7" title="אַ">&#xfb2e;</a>
+<a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;&#x5b7;</a>
+<a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;ַ</a>
+<a href="/wiki/%D7%90%D6%B7" title="אַ">א&#x5b7;</a>
+<a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
+</p>
+!! end
+
 !! test
 Empty attribute crash test (bug 2067)
 !! input
@@ -4389,6 +4476,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
@@ -4705,7 +4809,7 @@ disabled
 !! input
 <br id=9 />
 !! result
-Something, but defenetly not <br id="9" />...
+Something, but definitely not <br id="9" />...
 !! end
 
 !! test
@@ -5253,17 +5357,19 @@ New wiki paragraph
 </p>
 !! end
 
-# This was the original html, but it has also been
-# <p>'<i>bold'</i><b>bold<i>bolditalics</i></b>
+# Original result was this:
+# <p><b>bold</b><b>bold<i>bolditalics</i></b>
 # </p>
-# See bug 18765.
+# While that might be marginally more intuitive, maybe, the six-apostrophe
+# construct is clearly pathological and the result stated here (which is what
+# the parser actually does) is about as reasonable as anything.
 !!test
 Mixing markup for italics and bold
 !! options
 !! input
 '''bold''''''bold''bolditalics'''''
 !! result
-<p><b>bold</b><b>bold<i>bolditalics</i></b>
+<p>'<i>bold'</i><b>bold<i>bolditalics</i></b>
 </p>
 !! end
 
@@ -6283,6 +6389,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
@@ -6329,6 +6526,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
@@ -6379,7 +6585,7 @@ Width + Height sized image (using px) (height is ignored)
 !! input
 [[Image:foobar.jpg|640x480px]]
 !! result
-<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
 </p>
 !!end
 
@@ -6388,7 +6594,7 @@ Width-sized image (using px, no following whitespace)
 !! input
 [[Image:foobar.jpg|640px]]
 !! result
-<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
 </p>
 !!end
 
@@ -6397,7 +6603,7 @@ Width-sized image (using px, with following whitespace - test regression from r3
 !! input
 [[Image:foobar.jpg|640px ]]
 !! result
-<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
 </p>
 !!end
 
@@ -6406,7 +6612,7 @@ Width-sized image (using px, with preceding whitespace - test regression from r3
 !! input
 [[Image:foobar.jpg| 640px]]
 !! result
-<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" width="640" height="73" /></a>
+<p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
 </p>
 !!end
 
@@ -6415,7 +6621,7 @@ Another italics / bold test
 !! input
  ''' ''x'
 !! result
-<pre>&#39;<i> </i>x'
+<pre>'<i> </i>x'
 </pre>
 !!end
 
@@ -6443,12 +6649,10 @@ disabled
 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
 Images with the "|" character in the comment
-!! options
-disabled
 !! input
 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="An external URL" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>An <a href="http://test/?param1=|left|&amp;param2=|x" class="external text" rel="nofollow">external</a> URL</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>An <a href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx" class="external text" rel="nofollow">external</a> URL</div></div></div>
 
 !!end
 
@@ -6500,12 +6704,14 @@ subpage title=[[Subpage test/L1/L2/L3]]
 !! test
 Parents of subpages, two levels up
 !! options
-disabled
 subpage title=[[Subpage test/L1/L2/L3]]
 !! input
 [[../../|L1]]2
+
+[[../../|L1]]l
 !! result
-<p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>
+<p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
+</p><p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
 </p>
 !! end
 
@@ -7202,6 +7408,20 @@ Line two
 
 !! end
 
+!! test
+Nesting tags, paragraphs on lines which begin with <div>
+!! options
+disabled
+!! input
+<div></div><strong>A
+B</strong>
+!! result
+<div></div>
+<p><strong>A
+B</strong>
+</p>
+!! end
+
 # Bug 6200: <blockquote> should behave like <div> with respect to line breaks
 !! test
 Bug 6200: paragraphs inside blockquotes (no extra line breaks)
@@ -7349,7 +7569,7 @@ Free external link invading image caption
 !! input
 [[Image:Foobar.jpg|thumb|http://x|hello]]
 !! result
-<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-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>hello</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><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>hello</div></div></div>
 
 !! end
 
@@ -7558,273 +7778,168 @@ title=[[Main Page]]
 <a href="/wiki/Main_Page#section" title="Main Page">#section</a>
 !! end
 
-!! test
-Bold/italic markup handled differently depending on leading whitespace (bug 18765)
-!!input
-'''Look at ''this edit'''s complicated bold/italic markup!'''
-
-<!-- Comment -->'''Look at ''this edit'''s complicated bold/italic markup!'''
-
-<span> '''Look at ''this edit'''s complicated bold/italic markup!'''</span>
-
-<nowiki></nowiki> '''Look at ''this edit'''s complicated bold/italic markup!'''
-
-<!-- Hello world---> '''Look at ''this edit'''s complicated bold/italic markup!'''
-
-{|
-| '''Look at ''this edit'''s complicated bold/italic markup!'''
-|}
+!!article
+MediaWiki:bad image list
+!!text
+* [[File:Bad.jpg]] except [[Nasty page]]
+!!endarticle
 
-'''This was Italic'' this was plain''' and this was bold'''
-but '''This is bold'' this is bold italic''' and this is bold'''
+!! test
+Bad images - basic functionality
+!! input
+[[File:Bad.jpg]]
+!! result
+!! end
 
-<!-- Wishlist: Breaking because <span> and | are treated as text 
-<span>'''Look at ''this edit'''s complicated bold/italic markup!'''</span> 
-{|
-|'''Look at ''this edit'''s complicated bold/italic markup!'''
-|}
--->
+!! test
+Bad images - bug 16039: text after bad image disappears
+!! input
+Foo bar
+[[File:Bad.jpg]]
+Bar foo
 !! result
-<p><b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b>
-</p><p><b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b>
-</p><p><span> <b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b></span>
-</p><p> <b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b>
-</p>
-<pre><b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b>
-</pre>
-<table>
-<tr>
-<td> <b>Look at <i>this edit&#39;</i>s complicated bold/italic markup!</b>
-</td></tr></table>
-<p><b>This was Italic<i> this was plain&#39;</i> and this was bold</b>
-but <b>This is bold<i> this is bold italic&#39;</i> and this is bold</b>
-</p><p><br />
+<p>Foo bar
+</p><p>Bar foo
 </p>
 !! end
 
 !! test
-Six quotes
-!!input
-''Italic''''''Bold
-
-'''Bold''BoldItalic''''''Normal
-
-''Italic'''BoldItalic''''''Normal'''''
-
-'''''BoldItalic''''''MoreBoldItalic''
-
-''''''Normal
-!!result
-<p><i>Italic'</i><b>Bold</b>
-</p><p><b>Bold<i>BoldItalic'</i></b>Normal
-</p><p><i>Italic<b>BoldItalic'</b></i>Normal
-</p><p><i><b>BoldItalic</b><b>MoreBoldItalic</b></i>
-</p><p>Normal
+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
-
+!! end
 
 !! test
-Too many quotes
-!!input
-I '''like'''''quotes''''''''''' 
+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
-<p>I <b>like</b><i>quotes''''''</i><b> </b>
+whatever
+<p>this is not the the title
 </p>
 !! end
 
-
-Note: some elements used in these Microdata examples don't work, like <img>
-and <time>.
 !! test
-Microdata: vCard example from spec (with some tweaks)
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
 !! input
-<div id="jack" itemscope itemtype="http://microformats.org/profile/hcard">
-<h1 itemprop="fn">Jack Bauer</h1>
-<img itemprop="photo" alt="" src="jack-bauer.jpg">
-<p itemprop="org" itemscope>
-<span itemprop="organization-name">Counter-Terrorist Unit</span>
-(<span itemprop="organization-unit">Los Angeles Division</span>)
-</p>
-<p>
-<span itemprop="adr" itemscope>
-<span itemprop="street-address">10201 W. Pico Blvd.</span><br>
-<span itemprop="locality">Los Angeles</span>,
-<span itemprop="region">CA</span>
-<span itemprop="postal-code">90064</span><br>
-<span itemprop="country-name">United States</span><br>
-</span>
-<span itemprop="geo">34.052339;-118.410623</span>
-</p>
-<h2>Assorted Contact Methods</h2>
-<ul>
-<li itemprop="tel" itemscope>
-<span itemprop="value">+1 (310) 597 3781</span> <span itemprop="type">work</span>
-<meta itemprop="type" content="pref">
-</li>
-<li><a itemprop="url" href="http://en.wikipedia.org/wiki/Jack_Bauer">I'm on Wikipedia</a>
-so you can leave a message on my user talk page.</li>
-<li><a itemprop="url" href="http://www.jackbauerfacts.com/">Jack Bauer Facts</a></li>
-<li itemprop="email"><a href="mailto:j.bauer@la.ctu.gov.invalid">j.bauer@la.ctu.gov.invalid</a></li>
-<li itemprop="tel" itemscope>
-<span itemprop="value">+1 (310) 555 3781</span> <span>
-<meta itemprop="type" content="cell">mobile phone</span>
-</li>
-</ul>
-<p itemprop="note">If I'm out in the field, you may be better off contacting <span
-itemprop="agent" itemscope itemtype="http://microformats.org/profile/hcard"><a
-itemprop="email" href="mailto:c.obrian@la.ctu.gov.invalid"><span
-itemprop="fn">Chloe O'Brian</span></a></span> if it's about work, or ask <span
-itemprop="agent">Tony Almeida</span> if you're interested in the CTU five-a-side football team we're trying to get going.</p>
-<span itemprop="rev" itemscope>
-<meta itemprop="type" content="date-time">
-<meta itemprop="value" content="2008-07-20T21:00:00+0100">
-</span>
-<p itemprop="tel" itemscope><strong>Update!</strong>
-My new <span itemprop="type">home</span> phone number is
-<span itemprop="value">01632 960 123</span>.
-</p>
-</div>
+this is not the the title
+{{DISPLAYTITLE:whatever}}
 !! result
-<div id="jack" itemscope="itemscope" itemtype="http&#58;//microformats.org/profile/hcard">
-<h1 itemprop="fn"> <span class="mw-headline" id="Jack_Bauer">Jack Bauer</span></h1>
-<p>&lt;img itemprop="photo" alt="" src="jack-bauer.jpg"&gt;
-</p>
-<p itemprop="org" itemscope="itemscope">
-<span itemprop="organization-name">Counter-Terrorist Unit</span>
-(<span itemprop="organization-unit">Los Angeles Division</span>)
-</p>
-<p>
-<span itemprop="adr" itemscope="itemscope">
-<span itemprop="street-address">10201 W. Pico Blvd.</span><br />
-<span itemprop="locality">Los Angeles</span>,
-<span itemprop="region">CA</span>
-<span itemprop="postal-code">90064</span><br />
-<span itemprop="country-name">United States</span><br />
-</span>
-<span itemprop="geo">34.052339;-118.410623</span>
-</p>
-<h2> <span class="mw-headline" id="Assorted_Contact_Methods">Assorted Contact Methods</span></h2>
-<ul>
-<li itemprop="tel" itemscope="itemscope">
-<span itemprop="value">+1 (310) 597 3781</span> <span itemprop="type">work</span>
-&lt;meta itemprop="type" content="pref"&gt;
-</li>
-<li><a href="http://en.wikipedia.org/wiki/Jack_Bauer" class="external " itemprop="url">I'm on Wikipedia</a>
-so you can leave a message on my user talk page.</li>
-<li><a href="http://www.jackbauerfacts.com/" class="external " itemprop="url">Jack Bauer Facts</a></li>
-<li itemprop="email"><a href="mailto:j.bauer@la.ctu.gov.invalid" class="external ">j.bauer@la.ctu.gov.invalid</a></li>
-<li itemprop="tel" itemscope="itemscope">
-<span itemprop="value">+1 (310) 555 3781</span> <span>
-&lt;meta itemprop="type" content="cell"&gt;mobile phone</span>
-</li>
-</ul>
-<p itemprop="note">If I'm out in the field, you may be better off contacting <span itemprop="agent" itemscope="itemscope" itemtype="http&#58;//microformats.org/profile/hcard"><a href="mailto:c.obrian@la.ctu.gov.invalid" class="external " itemprop="email"><span itemprop="fn">Chloe O'Brian</span></a></span> if it's about work, or ask <span itemprop="agent">Tony Almeida</span> if you're interested in the CTU five-a-side football team we're trying to get going.</p>
-<p><span itemprop="rev" itemscope="itemscope">
-&lt;meta itemprop="type" content="date-time"&gt;
-&lt;meta itemprop="value" content="2008-07-20T21:00:00+0100"&gt;
-</span>
-</p>
-<p itemprop="tel" itemscope="itemscope"><strong>Update!</strong>
-My new <span itemprop="type">home</span> phone number is
-<span itemprop="value">01632 960 123</span>.
+Screen
+<p>this is not the the title
 </p>
-</div>
-
 !! end
 
 !! test
-Microdata: vEvent example from spec (with some tweaks)
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
 !! input
-<div itemscope itemtype="http://microformats.org/profile/hcalendar#vevent">
-<p>I'm going to
-<strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
-<time itemprop="dtstart" datetime="2009-05-05T19:00:00Z">May 5th at 7pm</time>
-to <time itemprop="dtend" content="2009-05-05T21:00:00Z">9pm</time>,
-at <span itemprop="location">The RoadHouse</span>!</p>
-<p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road"
-itemprop="url">See this event on livebrum.co.uk</a>.</p>
-<meta itemprop="description" content="via livebrum.co.uk">
-</div>
+this is not the the title
+{{DISPLAYTITLE:screen}}
 !! result
-<div itemscope="itemscope" itemtype="http&#58;//microformats.org/profile/hcalendar#vevent">
-<p>I'm going to
-<strong itemprop="summary">Bluesday Tuesday: Money Road</strong>,
-&lt;time itemprop="dtstart" datetime="2009-05-05T19:00:00Z"&gt;May 5th at 7pm&lt;/time&gt;
-to &lt;time itemprop="dtend" content="2009-05-05T21:00:00Z"&gt;9pm&lt;/time&gt;,
-at <span itemprop="location">The RoadHouse</span>!</p>
-<p><a href="http://livebrum.co.uk/2009/05/05/bluesday-tuesday-money-road" class="external " itemprop="url">See this event on livebrum.co.uk</a>.</p>
-<p>&lt;meta itemprop="description" content="via livebrum.co.uk"&gt;
+screen
+<p>this is not the the title
 </p>
-</div>
-
 !! end
 
 !! test
-Microdata: license example from spec (with some tweaks)
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
 !! input
-<div itemscope itemtype="http://n.whatwg.org/work">
-<img itemprop="work" src="mypond.jpeg">
-<p><cite itemprop="title">My Pond</cite></p>
-<p><small>Licensed under the <a itemprop="license"
-href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative
-Commons Attribution-Share Alike 3.0 United States License</a>
-and the <a itemprop="license"
-href="http://www.opensource.org/licenses/mit-license.php">MIT
-license</a>.</small></p>
-</div>
+this is not the the title
+{{DISPLAYTITLE:screen}}
 !! result
-<div itemscope="itemscope" itemtype="http&#58;//n.whatwg.org/work">
-<p>&lt;img itemprop="work" src="mypond.jpeg"&gt;
+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>
-<p><cite itemprop="title">My Pond</cite></p>
-<p><small>Licensed under the <a href="http://creativecommons.org/licenses/by-sa/3.0/us/" class="external " itemprop="license">Creative
-Commons Attribution-Share Alike 3.0 United States License</a>
-and the <a href="http://www.opensource.org/licenses/mit-license.php" class="external " itemprop="license">MIT
-license</a>.</small></p>
-</div>
-
 !! end
 
 !! test
-Microdata: license example from spec with bad itemtype
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE
+!! options
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
 !! input
-<div itemscope itemtype="http://nonstandard.invalid/">
-<img itemprop="work" src="mypond.jpeg">
-<p><cite itemprop="title">My Pond</cite></p>
-<p><small>Licensed under the <a itemprop="license"
-href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative
-Commons Attribution-Share Alike 3.0 United States License</a>
-and the <a itemprop="license"
-href="http://www.opensource.org/licenses/mit-license.php">MIT
-license</a>.</small></p>
-</div>
+this is not the the title
 !! result
-<div>
-<p>&lt;img itemprop="work" src="mypond.jpeg"&gt;
+Screen
+<p>this is not the the title
 </p>
-<p><cite itemprop="title">My Pond</cite></p>
-<p><small>Licensed under the <a href="http://creativecommons.org/licenses/by-sa/3.0/us/" class="external " itemprop="license">Creative
-Commons Attribution-Share Alike 3.0 United States License</a>
-and the <a href="http://www.opensource.org/licenses/mit-license.php" class="external " itemprop="license">MIT
-license</a>.</small></p>
-</div>
-
 !! end
-
-!!article
-MediaWiki:bad image list
-!!text
-* [[File:Bad.jpg]] except [[Nasty page]]
-!!endarticle
+!! 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
-Bad images - basic functionality
+preload: can pass tags through if we want to
+!! options
+preload
 !! input
-[[File:Bad.jpg]]
+<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