Group definition list tests; add doc link
authorGabriel Wicke <gwicke@wikimedia.org>
Wed, 27 Jun 2012 14:25:15 +0000 (16:25 +0200)
committerGabriel Wicke <gwicke@wikimedia.org>
Wed, 27 Jun 2012 14:25:15 +0000 (16:25 +0200)
* Moved the new definition list tests close to the existing ones
* Added a link to the relevant bug and discussion to the documentation about
  differences in nested definition list handling between the PHP parser and
  Parsoid

Change-Id: I94fe59db33a242c505d5e82631ccdeef6155fb04

tests/parser/parserTests.txt

index ece2a9c..651858c 100644 (file)
@@ -931,372 +931,743 @@ Paragraph text
 </p>
 !! end
 
-###
-### External links
-###
 !! test
-External links: non-bracketed
+Definition Lists: No nesting: Multiple dd's
 !! input
-Non-bracketed: http://example.com
+;x
+:a
+:b
 !! result
-<p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
-</p>
+<dl><dt>x
+</dt><dd>a
+</dd><dd>b
+</dd></dl>
+
 !! end
 
 !! test
-External links: numbered
+Definition Lists: Indentation: Regular
 !! input
-Numbered: [http://example.com]
-Numbered: [http://example.net]
-Numbered: [http://example.com]
+:i1
+::i2
+:::i3
 !! result
-<p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
-Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
-Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
-</p>
-!!end
+<dl><dd>i1
+<dl><dd>i2
+<dl><dd>i3
+</dd></dl>
+</dd></dl>
+</dd></dl>
 
-!! test
-External links: specified text
-!! input
-Specified text: [http://example.com link]
-!! result
-<p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
-</p>
-!!end
+!! end
 
 !! test
-External links: trail
+Definition Lists: Indentation: Missing 1st level
 !! input
-Linktrails should not work for external links: [http://example.com link]s
+::i2
+:::i3
 !! result
-<p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
-</p>
+<dl><dd><dl><dd>i2
+<dl><dd>i3
+</dd></dl>
+</dd></dl>
+</dd></dl>
+
 !! end
 
 !! test
-External links: dollar sign in URL
+Definition Lists: Indentation: Multi-level indent
 !! input
-http://example.com/1$2345
+:::i3
 !! result
-<p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
-</p>
+<dl><dd><dl><dd><dl><dd>i3
+</dd></dl>
+</dd></dl>
+</dd></dl>
+
 !! end
 
-!! test
-External links: dollar sign in URL (named)
-!! input
-[http://example.com/1$2345]
-!! result
-<p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
-</p>
-!!end
+## The PHP parser treats : items (dd) without a corresponding ; item (dt)
+## as an empty dt item.  It also ignores all but the last ";" when followed
+## by ":" later on.  So, ";" are not ignored in ";;;t3" but are ignored  in
+## ";;;t3 :d1".  So, PHP parser behavior is a little inconsistent wrt multiple
+## ";"s.
+##
+## Ex: ";;t2 ::d2" is transformed into:
+##
+## <dl>
+##   <dt>t2 </dt>
+##   <dd>
+##     <dl>
+##       <dt></dt>
+##       <dd>d2</dd>
+##     </dl>
+##   </dd>
+## </dl>
+##
+## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
+## So, the same wikitext above (;;t2 ::d2) is transformed into:
+##
+## <dl>
+##   <dt>
+##     <dl>
+##       <dt>t2 </dt>
+##       <dd>:d2</dd>
+##     </dl>
+##    </dt>
+## </dl>
+##
+## All Parsoid only definition list tests have this difference.
+##
+## See also: https://bugzilla.wikimedia.org/show_bug.cgi?id=6569 
+## and http://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html
 
 !! test
-External links: open square bracket forbidden in URL (bug 4377)
+Definition Lists: Nesting: Multi-level (Parsoid only)
+!! options
+disabled
 !! input
-http://example.com/1[2345
+;t1 :d1
+;;t2 ::d2
+;;;t3 :::d3
 !! result
-<p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
-</p>
+<dl>
+  <dt>t1 </dt>
+  <dd>d1</dd>
+  <dt>
+    <dl>
+      <dt>t2 </dt>
+      <dd>:d2</dd>
+      <dt>
+        <dl>
+          <dt>t3 </dt>
+          <dd>::d3</dd>
+        </dl>
+      </dt>
+    </dl>
+  </dt>
+</dl>
+
+
 !! end
 
+
 !! test
-External links: open square bracket forbidden in URL (named) (bug 4377)
+Definition Lists: Nesting: Test 2 (Parsoid only)
+!! options
+disabled
 !! input
-[http://example.com/1[2345]
+;t1
+::d2
 !! result
-<p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
-</p>
-!!end
+<dl>
+  <dt>t1</dt>
+  <dd>
+    <dl>
+      <dd>d2</dd>
+    </dl>
+  </dd>
+</dl>
 
-!! test
-External links: nowiki in URL link text (bug 6230)
-!!input
-[http://example.com/ <nowiki>''example site''</nowiki>]
-!! result
-<p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
-</p>
 !! end
 
-!! test
-External links: newline forbidden in text (bug 6230 regression check)
-!! input
-[http://example.com/ first
-second]
-!! result
-<p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
-second]
-</p>
-!!end
 
 !! test
-External links: protocol-relative URL in brackets
+Definition Lists: Nesting: Test 3 (Parsoid only)
+!! options
+disabled
 !! input
-[//example.com/ Test]
+:;t1
+::::d2
 !! result
-<p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
-</p>
+<dl>
+  <dd>
+    <dl>
+      <dt>t1</dt>
+      <dd>
+        <dl>
+          <dd>
+            <dl>
+              <dd>d2</dd>
+            </dl>
+          </dd>
+        </dl>
+      </dd>
+    </dl>
+  </dd>
+</dl>
+
 !! end
 
+
 !! test
-External links: protocol-relative URL in brackets without text
+Definition Lists: Nesting: Test 4
 !! input
-[//example.com]
+::;t3
+:::d3
 !! result
-<p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
-</p>
+<dl><dd><dl><dd><dl><dt>t3
+</dt><dd>d3
+</dd></dl>
+</dd></dl>
+</dd></dl>
+
 !! end
 
-!! test
-External links: protocol-relative URL in free text is left alone
-!! input
-//example.com/Foo
-!! result
-<p>//example.com/Foo
-</p>
-!!end
 
 !! test
-External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
+Definition Lists: Mixed Lists: Test 1
 !! input
-foo//example.com/Foo
+:;* foo
+::* bar
+:; baz
 !! result
-<p>foo//example.com/Foo
-</p>
+<dl><dd><dl><dt><ul><li> foo
+</li><li> bar
+</li></ul>
+</dt></dl>
+<dl><dt> baz
+</dt></dl>
+</dd></dl>
+
 !! end
 
+
 !! test
-External image
+Definition Lists: Mixed Lists: Test 2
 !! input
-External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+*: d1
+*: d2
 !! result
-<p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
-</p>
+<ul><li><dl><dd> d1
+</dd><dd> d2
+</dd></dl>
+</li></ul>
+
 !! end
 
+
 !! test
-External image from https
+Definition Lists: Mixed Lists: Test 3
 !! input
-External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+*::: d1
+*::: d2
 !! result
-<p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
-</p>
+<ul><li><dl><dd><dl><dd><dl><dd> d1
+</dd><dd> d2
+</dd></dl>
+</dd></dl>
+</dd></dl>
+</li></ul>
+
 !! end
 
+
 !! test
-Link to non-http image, no img tag
+Definition Lists: Mixed Lists: Test 4
 !! input
-Link to non-http image, no img tag: ftp://example.com/test.jpg
+*;d1 :d2
+*;d3 :d4
 !! result
-<p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
-</p>
+<ul><li><dl><dt>d1&#160;</dt><dd>d2
+</dd><dt>d3&#160;</dt><dd>d4
+</dd></dl>
+</li></ul>
+
 !! end
 
+
 !! test
-External links: terminating separator
+Definition Lists: Mixed Lists: Test 5
 !! input
-Terminating separator: http://example.com/thing,
+*:d1
+*:: d2
 !! result
-<p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
-</p>
+<ul><li><dl><dd>d1
+<dl><dd> d2
+</dd></dl>
+</dd></dl>
+</li></ul>
+
 !! end
 
+
 !! test
-External links: intervening separator
+Definition Lists: Mixed Lists: Test 6
 !! input
-Intervening separator: http://example.com/1,2,3
+#*:d1
+#*::: d3
 !! result
-<p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
-</p>
+<ol><li><ul><li><dl><dd>d1
+<dl><dd><dl><dd> d3
+</dd></dl>
+</dd></dl>
+</dd></dl>
+</li></ul>
+</li></ol>
+
 !! end
 
+
 !! test
-External links: old bug with URL in query
+Definition Lists: Mixed Lists: Test 7
 !! input
-Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
+:* d1
+:* d2
 !! result
-<p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
-</p>
+<dl><dd><ul><li> d1
+</li><li> d2
+</li></ul>
+</dd></dl>
+
 !! end
 
-!! test
-External links: old URL-in-URL bug, mixed protocols
-!! input
-And again with mixed protocols: [ftp://example.com?url=http://example.com link]
-!! result
-<p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
-</p>
-!!end
 
 !! test
-External links: URL in text
+Definition Lists: Mixed Lists: Test 8
 !! input
-URL in text: [http://example.com http://example.com]
+:* d1
+::* d2
 !! result
-<p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
-</p>
+<dl><dd><ul><li> d1
+</li></ul>
+<dl><dd><ul><li> d2
+</li></ul>
+</dd></dl>
+</dd></dl>
+
 !! end
 
+
 !! test
-External links: Clickable images
+Definition Lists: Mixed Lists: Test 9
 !! input
-ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
+*;foo :bar
 !! result
-<p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
-</p>
-!!end
+<ul><li><dl><dt>foo&#160;</dt><dd>bar
+</dd></dl>
+</li></ul>
+
+!! end
+
 
 !! test
-External links: raw ampersand
+Definition Lists: Mixed Lists: Test 10
 !! input
-Old &amp; use: http://x&y
+*#;foo :bar
 !! result
-<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
-</p>
+<ul><li><ol><li><dl><dt>foo&#160;</dt><dd>bar
+</dd></dl>
+</li></ol>
+</li></ul>
+
 !! end
 
+
 !! test
-External links: encoded ampersand
+Definition Lists: Mixed Lists: Test 11
 !! input
-Old &amp; use: http://x&amp;y
+*#*#;*;;foo :bar
+*#*#;boo :baz
 !! result
-<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
-</p>
+<ul><li><ol><li><ul><li><ol><li><dl><dt>foo&#160;</dt><dd><ul><li><dl><dt><dl><dt>bar
+</dt></dl>
+</dd></dl>
+</li></ul>
+</dd></dl>
+<dl><dt>boo&#160;</dt><dd>baz
+</dd></dl>
+</li></ol>
+</li></ul>
+</li></ol>
+</li></ul>
+
 !! end
 
+
 !! test
-External links: encoded equals (bug 6102)
+Definition Lists: Weird Ones: Test 1
 !! input
-http://example.com/?foo&#61;bar
+*#;*::;; foo : bar (who uses this?)
 !! result
-<p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
-</p>
+<ul><li><ol><li><dl><dt> foo&#160;</dt><dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)
+</dt></dl>
+</dd></dl>
+</dd></dl>
+</dd></dl>
+</li></ul>
+</dd></dl>
+</li></ol>
+</li></ul>
+
 !! end
 
+###
+### External links
+###
 !! test
-External links: [raw ampersand]
+External links: non-bracketed
 !! input
-Old &amp; use: [http://x&y]
+Non-bracketed: http://example.com
 !! result
-<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
+<p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 </p>
 !! end
 
 !! test
-External links: [encoded ampersand]
+External links: numbered
 !! input
-Old &amp; use: [http://x&amp;y]
+Numbered: [http://example.com]
+Numbered: [http://example.net]
+Numbered: [http://example.com]
 !! result
-<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
+<p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
+Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
+Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
 </p>
-!! end
+!!end
 
 !! test
-External links: [encoded equals] (bug 6102)
+External links: specified text
 !! input
-[http://example.com/?foo&#61;bar]
+Specified text: [http://example.com link]
 !! result
-<p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
+<p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
 </p>
-!! end
+!!end
 
 !! test
-External links: [IDN ignored character reference in hostname; strip it right off]
+External links: trail
 !! input
-[http://e&zwnj;xample.com/]
+Linktrails should not work for external links: [http://example.com link]s
 !! result
-<p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
+<p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
 </p>
 !! end
 
 !! test
-External links: IDN ignored character reference in hostname; strip it right off
+External links: dollar sign in URL
 !! input
-http://e&zwnj;xample.com/
+http://example.com/1$2345
 !! result
-<p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
+<p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
 </p>
 !! end
 
 !! test
-External links: www.jpeg.org (bug 554)
+External links: dollar sign in URL (named)
 !! input
-http://www.jpeg.org
-!!result
-<p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
+[http://example.com/1$2345]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
 </p>
-!! end
+!!end
 
 !! test
-External links: URL within URL (original bug 2)
+External links: open square bracket forbidden in URL (bug 4377)
 !! input
-[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
+http://example.com/1[2345
 !! result
-<p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
+<p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
 </p>
 !! end
 
 !! test
-BUG 361: URL inside bracketed URL
+External links: open square bracket forbidden in URL (named) (bug 4377)
 !! input
-[http://www.example.com/foo http://www.example.com/bar]
+[http://example.com/1[2345]
 !! result
-<p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
+<p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
 </p>
-!! end
+!!end
 
 !! test
-BUG 361: URL within URL, not bracketed
-!! input
-http://www.example.com/foo?=http://www.example.com/bar
+External links: nowiki in URL link text (bug 6230)
+!!input
+[http://example.com/ <nowiki>''example site''</nowiki>]
 !! result
-<p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
+<p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
 </p>
 !! end
 
 !! test
-BUG 289: ">"-token in URL-tail
+External links: newline forbidden in text (bug 6230 regression check)
 !! input
-http://www.example.com/<hello>
+[http://example.com/ first
+second]
 !! result
-<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
+<p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
+second]
 </p>
 !!end
 
 !! test
-BUG 289: literal ">"-token in URL-tail
+External links: protocol-relative URL in brackets
 !! input
-http://www.example.com/<b>html</b>
+[//example.com/ Test]
 !! result
-<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
+<p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
 </p>
-!!end
+!! end
 
 !! test
-BUG 289: ">"-token in bracketed URL
+External links: protocol-relative URL in brackets without text
 !! input
-[http://www.example.com/<hello> stuff]
+[//example.com]
 !! result
-<p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
+<p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
 </p>
-!!end
+!! end
 
 !! test
-BUG 289: literal ">"-token in bracketed URL
+External links: protocol-relative URL in free text is left alone
 !! input
-[http://www.example.com/<b>html</b> stuff]
+//example.com/Foo
 !! result
-<p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
+<p>//example.com/Foo
 </p>
 !!end
 
 !! test
-BUG 289: literal double quote at end of URL
+External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
 !! input
-http://www.example.com/"hello"
+foo//example.com/Foo
 !! result
-<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
+<p>foo//example.com/Foo
+</p>
+!! end
+
+!! test
+External image
+!! input
+External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+!! result
+<p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
+</p>
+!! end
+
+!! test
+External image from https
+!! input
+External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+!! result
+<p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
+</p>
+!! end
+
+!! test
+Link to non-http image, no img tag
+!! input
+Link to non-http image, no img tag: ftp://example.com/test.jpg
+!! result
+<p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
+</p>
+!! end
+
+!! test
+External links: terminating separator
+!! input
+Terminating separator: http://example.com/thing,
+!! result
+<p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
+</p>
+!! end
+
+!! test
+External links: intervening separator
+!! input
+Intervening separator: http://example.com/1,2,3
+!! result
+<p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
+</p>
+!! end
+
+!! test
+External links: old bug with URL in query
+!! input
+Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
+!! result
+<p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
+</p>
+!! end
+
+!! test
+External links: old URL-in-URL bug, mixed protocols
+!! input
+And again with mixed protocols: [ftp://example.com?url=http://example.com link]
+!! result
+<p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
+</p>
+!!end
+
+!! test
+External links: URL in text
+!! input
+URL in text: [http://example.com http://example.com]
+!! result
+<p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
+</p>
+!! end
+
+!! test
+External links: Clickable images
+!! input
+ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
+!! result
+<p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
+</p>
+!!end
+
+!! test
+External links: raw ampersand
+!! input
+Old &amp; use: http://x&y
+!! result
+<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
+</p>
+!! end
+
+!! test
+External links: encoded ampersand
+!! input
+Old &amp; use: http://x&amp;y
+!! result
+<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
+</p>
+!! end
+
+!! test
+External links: encoded equals (bug 6102)
+!! input
+http://example.com/?foo&#61;bar
+!! result
+<p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
+</p>
+!! end
+
+!! test
+External links: [raw ampersand]
+!! input
+Old &amp; use: [http://x&y]
+!! result
+<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
+</p>
+!! end
+
+!! test
+External links: [encoded ampersand]
+!! input
+Old &amp; use: [http://x&amp;y]
+!! result
+<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
+</p>
+!! end
+
+!! test
+External links: [encoded equals] (bug 6102)
+!! input
+[http://example.com/?foo&#61;bar]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
+</p>
+!! end
+
+!! test
+External links: [IDN ignored character reference in hostname; strip it right off]
+!! input
+[http://e&zwnj;xample.com/]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
+</p>
+!! end
+
+!! test
+External links: IDN ignored character reference in hostname; strip it right off
+!! input
+http://e&zwnj;xample.com/
+!! result
+<p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
+</p>
+!! end
+
+!! test
+External links: www.jpeg.org (bug 554)
+!! input
+http://www.jpeg.org
+!!result
+<p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
+</p>
+!! end
+
+!! test
+External links: URL within URL (original bug 2)
+!! input
+[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
+</p>
+!! end
+
+!! test
+BUG 361: URL inside bracketed URL
+!! input
+[http://www.example.com/foo http://www.example.com/bar]
+!! result
+<p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
+</p>
+!! end
+
+!! test
+BUG 361: URL within URL, not bracketed
+!! input
+http://www.example.com/foo?=http://www.example.com/bar
+!! result
+<p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
+</p>
+!! end
+
+!! test
+BUG 289: ">"-token in URL-tail
+!! input
+http://www.example.com/<hello>
+!! result
+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
+</p>
+!!end
+
+!! test
+BUG 289: literal ">"-token in URL-tail
+!! input
+http://www.example.com/<b>html</b>
+!! result
+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
+</p>
+!!end
+
+!! test
+BUG 289: ">"-token in bracketed URL
+!! input
+[http://www.example.com/<hello> stuff]
+!! result
+<p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
+</p>
+!!end
+
+!! test
+BUG 289: literal ">"-token in bracketed URL
+!! input
+[http://www.example.com/<b>html</b> stuff]
+!! result
+<p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
+</p>
+!!end
+
+!! test
+BUG 289: literal double quote at end of URL
+!! input
+http://www.example.com/"hello"
+!! result
+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
 </p>
 !!end
 
@@ -7676,2511 +8047,2144 @@ foobar.jpg
                        <div class="gallerytext">
                        </div>
                </div></li>
-</ul>
-
-!! end
-
-!! test
-HTML Hex character encoding (spells the word "JavaScript")
-!! input
-&#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
-!! result
-<p>&#x4a;&#x61;&#x76;&#x61;&#x53;&#x63;&#114;&#x69;&#112;&#x74;
-</p>
-!! end
-
-!! test
-HTML Hex character encoding bogus encoding (bug 26437 regression check)
-!! input
-&#xsee;&#XSEE;
-!! result
-<p>&amp;#xsee;&amp;#XSEE;
-</p>
-!! end
-
-!! test
-HTML Hex character encoding mixed case
-!! input
-&#xEE;&#Xee;
-!! result
-<p>&#xee;&#xee;
-</p>
-!! end
-
-!! test
-__FORCETOC__ override
-!! input 
-__NEWSECTIONLINK__
-__FORCETOC__
-!! result
-<p><br />
-</p>
-!! end
-
-!! test
-ISBN code coverage
-!! input
-ISBN  978-0-1234-56&#x20;789
-!! result
-<p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a>&#x20;789
-</p>
-!! end
-
-!! test
-ISBN followed by 5 spaces
-!! input
-ISBN    
-!! result
-<p>ISBN    
-</p>
-!! end
-
-!! test
-Double ISBN
-!! input
-ISBN ISBN 1234567890
-!! result
-<p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
-</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 rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
-</p>
-!! end
-
-!! test
-Double RFC
-!! input
-RFC RFC 1234
-!! result
-<p>RFC <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
-</p>
-!! end
-
-!! test
-Double RFC with a wiki link 
-!! input
-RFC [[RFC 1234]]
-!! result
-<p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
-</p>
-!! end
-
-!! test
-RFC code coverage
-!! input
-RFC   983&#x20;987
-!! result
-<p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
-</p>
-!! end
-
-!! test
-Centre-aligned image
-!! input
-[[Image:foobar.jpg|centre]]
-!! result
-<div class="center"><div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div></div>
-
-!!end
-
-!! test
-None-aligned image
-!! input
-[[Image:foobar.jpg|none]]
-!! result
-<div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
-
-!!end
-
-!! test
-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/3/3a/Foobar.jpg" width="640" height="73" /></a>
-</p>
-!!end
-
-!! test
-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/3/3a/Foobar.jpg" width="640" height="73" /></a>
-</p>
-!!end
-
-!! test
-Width-sized image (using px, with following whitespace - test regression from r39467)
-!! input
-[[Image:foobar.jpg|640px ]]
-!! result
-<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
-
-!! test
-Width-sized image (using px, with preceding whitespace - test regression from r39467)
-!! input
-[[Image:foobar.jpg| 640px]]
-!! result
-<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
-
-!! test
-Another italics / bold test
-!! input
- ''' ''x'
-!! result
-<pre>'<i> </i>x'
-</pre>
-!!end
-
-# Note the results may be incorrect, as parserTest output included this:
-# XML error: Mismatched tag at byte 6120:
-# ...<dd> </dt></dl> </dd...
-!! test
-dt/dd/dl test
-!! options
-disabled
-!! input
-:;;;::
-!! result
-<dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd>
-</dd></dl>
-</dd></dl>
-</dt></dl>
-</dt></dl>
-</dt></dl>
-</dd></dl>
-
-!!end
-
-
-# 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
-!! 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="" 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 rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
-
-!!end
-
-!! test
-[Before] HTML without raw HTML enabled ($wgRawHtml==false)
-!! input
-<html><script>alert(1);</script></html>
-!! result
-<p>&lt;html&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/html&gt;
-</p>
-!! end
-
-!! test
-HTML with raw HTML ($wgRawHtml==true)
-!! options
-rawhtml
-!! input
-<html><script>alert(1);</script></html>
-!! result
-<p><script>alert(1);</script>
-</p>
-!! end
-
-!! test
-Parents of subpages, one level up
-!! options
-subpage title=[[Subpage test/L1/L2/L3]]
-!! input
-[[../|L2]]
-!! result
-<p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
-</p>
-!! end
-
-
-!! test
-Parents of subpages, one level up, not named
-!! options
-subpage title=[[Subpage test/L1/L2/L3]]
-!! input
-[[../]]
-!! result
-<p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
-</p>
-!! end
-
-
-
-!! test
-Parents of subpages, two levels up
-!! options
-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>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
-
-!! test
-Parents of subpages, two levels up, without trailing slash or name.
-!! options
-subpage title=[[Subpage test/L1/L2/L3]]
-!! input
-[[../..]]
-!! result
-<p>[[../..]]
-</p>
-!! end
-
-!! test
-Parents of subpages, two levels up, with lots of extra trailing slashes.
-!! options
-subpage title=[[Subpage test/L1/L2/L3]]
-!! input
-[[../../////]]
-!! 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)">///</a>
-</p>
+</ul>
+
 !! end
 
 !! test
-Definition list code coverage
+HTML Hex character encoding (spells the word "JavaScript")
 !! input
-; title   : def
-; title : def
-;title: def
+&#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
 !! result
-<dl><dt> title  &#160;</dt><dd> def
-</dd><dt> title&#160;</dt><dd> def
-</dd><dt>title</dt><dd> def
-</dd></dl>
-
+<p>&#x4a;&#x61;&#x76;&#x61;&#x53;&#x63;&#114;&#x69;&#112;&#x74;
+</p>
 !! end
 
 !! test
-Don't fall for the self-closing div
+HTML Hex character encoding bogus encoding (bug 26437 regression check)
 !! input
-<div>hello world</div/>
+&#xsee;&#XSEE;
 !! result
-<div>hello world</div>
-
+<p>&amp;#xsee;&amp;#XSEE;
+</p>
 !! end
 
 !! test
-MSGNW magic word
+HTML Hex character encoding mixed case
 !! input
-{{MSGNW:msg}}
+&#xEE;&#Xee;
 !! result
-<p>&#91;&#91;:Template:Msg&#93;&#93;
+<p>&#xee;&#xee;
 </p>
 !! end
 
 !! test
-RAW magic word
-!! input
-{{RAW:QUERTY}}
+__FORCETOC__ override
+!! input 
+__NEWSECTIONLINK__
+__FORCETOC__
 !! result
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><br />
 </p>
 !! end
 
-# This isn't needed for XHTML conformance, but would be handy as a fallback security measure
 !! test
-Always escape literal '>' in output, not just after '<'
+ISBN code coverage
 !! input
-><>
+ISBN  978-0-1234-56&#x20;789
 !! result
-<p>&gt;&lt;&gt;
+<p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a>&#x20;789
 </p>
 !! end
 
 !! test
-Template caching
+ISBN followed by 5 spaces
 !! input
-{{Test}}
-{{Test}}
+ISBN    
 !! result
-<p>This is a test template
-This is a test template
+<p>ISBN    
 </p>
 !! end
 
-
-!! article
-MediaWiki:Fake
-!! text
-==header==
-!! endarticle
-
 !! test
-Inclusion of !userCanEdit() content
+Double ISBN
 !! input
-{{MediaWiki:Fake}}
+ISBN ISBN 1234567890
 !! result
-<h2><span class="editsection">[<a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a>]</span> <span class="mw-headline" id="header">header</span></h2>
-
+<p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
+</p>
 !! end
 
-
 !! test
-Out-of-order TOC heading levels
+Bug 22905: <abbr> followed by ISBN followed by </a>
 !! input
-==2==
-======6======
-===3===
-=1=
-=====5=====
-==2==
+<abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
-<ul>
-<li class="toclevel-2 tocsection-2"><a href="#6"><span class="tocnumber">1.1</span> <span class="toctext">6</span></a></li>
-<li class="toclevel-2 tocsection-3"><a href="#3"><span class="tocnumber">1.2</span> <span class="toctext">3</span></a></li>
-</ul>
-</li>
-<li class="toclevel-1 tocsection-4"><a href="#1"><span class="tocnumber">2</span> <span class="toctext">1</span></a>
-<ul>
-<li class="toclevel-2 tocsection-5"><a href="#5"><span class="tocnumber">2.1</span> <span class="toctext">5</span></a></li>
-<li class="toclevel-2 tocsection-6"><a href="#2_2"><span class="tocnumber">2.2</span> <span class="toctext">2</span></a></li>
-</ul>
-</li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2">2</span></h2>
-<h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: 6">edit</a>]</span> <span class="mw-headline" id="6">6</span></h6>
-<h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 3">edit</a>]</span> <span class="mw-headline" id="3">3</span></h3>
-<h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: 1">edit</a>]</span> <span class="mw-headline" id="1">1</span></h1>
-<h5><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: 5">edit</a>]</span> <span class="mw-headline" id="5">5</span></h5>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2_2">2</span></h2>
-
+<p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
+</p>
 !! end
 
-
 !! test
-ISBN with a dummy number
+Double RFC
 !! input
-ISBN ---
+RFC RFC 1234
 !! result
-<p>ISBN ---
+<p>RFC <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
 </p>
 !! end
 
-
 !! test
-ISBN with space-delimited number
+Double RFC with a wiki link 
 !! input
-ISBN 92 9017 032 8
+RFC [[RFC 1234]]
 !! result
-<p><a href="/wiki/Special:BookSources/9290170328" class="internal mw-magiclink-isbn">ISBN 92 9017 032 8</a>
+<p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
 </p>
 !! end
 
-
 !! test
-ISBN with multiple spaces, no number
+RFC code coverage
 !! input
-ISBN  foo
+RFC   983&#x20;987
 !! result
-<p>ISBN  foo
+<p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
 </p>
 !! end
 
-
 !! test
-ISBN length
+Centre-aligned image
 !! input
-ISBN 123456789
-
-ISBN 1234567890
-
-ISBN 12345678901
+[[Image:foobar.jpg|centre]]
 !! result
-<p>ISBN 123456789
-</p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
-</p><p>ISBN 12345678901
-</p>
-!! end
+<div class="center"><div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div></div>
 
+!!end
 
 !! test
-ISBN with trailing year (bug 8110)
+None-aligned image
 !! input
-ISBN 1-234-56789-0 - 2006
-
-ISBN 1 234 56789 0 - 2006
+[[Image:foobar.jpg|none]]
 !! result
-<p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1-234-56789-0</a> - 2006
-</p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1 234 56789 0</a> - 2006
-</p>
-!! end
+<div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
 
+!!end
 
 !! test
-anchorencode
+Width + Height sized image (using px) (height is ignored)
 !! input
-{{anchorencode:foo bar©#%n}}
+[[Image:foobar.jpg|640x480px]]
 !! result
-<p>foo_bar.C2.A9.23.25n
+<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
+!!end
 
 !! test
-anchorencode trims spaces
+Width-sized image (using px, no following whitespace)
 !! input
-{{anchorencode: __pretty__please__}}
+[[Image:foobar.jpg|640px]]
 !! result
-<p>pretty_please
+<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
+!!end
 
 !! test
-anchorencode deals with links
+Width-sized image (using px, with following whitespace - test regression from r39467)
 !! input
-{{anchorencode: [[hello|world]] [[hi]]}}
+[[Image:foobar.jpg|640px ]]
 !! result
-<p>world_hi
+<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
+!!end
 
 !! test
-anchorencode deals with templates
+Width-sized image (using px, with preceding whitespace - test regression from r39467)
 !! input
-{{anchorencode: {{Foo}} }}
+[[Image:foobar.jpg| 640px]]
 !! result
-<p>FOO
+<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
+!!end
 
 !! test
-anchorencode encodes like the TOC generator: (bug 18431)
+Another italics / bold test
 !! input
-=== _ +:.3A%3A&&amp;]] ===
-{{anchorencode: _ +:.3A%3A&&amp;]] }}
-__NOEDITSECTION__
+ ''' ''x'
 !! result
-<h3> <span class="mw-headline" id=".2B:.3A.253A.26.26.5D.5D"> _ +:.3A%3A&amp;&amp;]] </span></h3>
-<p>.2B:.3A.253A.26.26.5D.5D
-</p>
-!! end
+<pre>'<i> </i>x'
+</pre>
+!!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.
+# Note the results may be incorrect, as parserTest output included this:
+# XML error: Mismatched tag at byte 6120:
+# ...<dd> </dt></dl> </dd...
 !! test
-Bug 6200: blockquotes and paragraph formatting
+dt/dd/dl test
+!! options
+disabled
 !! input
-<blockquote>
-foo
-</blockquote>
+:;;;::
+!! result
+<dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd>
+</dd></dl>
+</dd></dl>
+</dt></dl>
+</dt></dl>
+</dt></dl>
+</dd></dl>
 
-bar
+!!end
 
- baz
-!! result
-<blockquote>
-foo
-</blockquote>
-<p>bar
-</p>
-<pre>baz
-</pre>
-!! end
 
+# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
-Bug 8293: Use of center tag ruins paragraph formatting
+Images with the "|" character in the comment
 !! input
-<center>
-foo
-</center>
+[[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="" 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 rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
 
-bar
+!!end
 
- baz
+!! test
+[Before] HTML without raw HTML enabled ($wgRawHtml==false)
+!! input
+<html><script>alert(1);</script></html>
 !! result
-<center>
-<p>foo
-</p>
-</center>
-<p>bar
+<p>&lt;html&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/html&gt;
 </p>
-<pre>baz
-</pre>
 !! end
 
-
-###
-### Language variants related tests
-###
 !! test
-Self-link in language variants
+HTML with raw HTML ($wgRawHtml==true)
 !! options
-title=[[Dunav]] language=sr
+rawhtml
 !! input
-Both [[Dunav]] and [[Дунав]] are names for this river.
+<html><script>alert(1);</script></html>
 !! result
-<p>Both <strong class="selflink">Dunav</strong> and <strong class="selflink">Дунав</strong> are names for this river.
+<p><script>alert(1);</script>
 </p>
-!!end
-
+!! end
 
 !! test
-Link to pages in language variants
+Parents of subpages, one level up
 !! options
-language=sr
+subpage title=[[Subpage test/L1/L2/L3]]
 !! input
-Main Page can be written as [[Маин Паге]]
+[[../|L2]]
 !! result
-<p>Main Page can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>
+<p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
 </p>
-!!end
+!! end
 
 
 !! test
-Multiple links to pages in language variants
+Parents of subpages, one level up, not named
 !! options
-language=sr
+subpage title=[[Subpage test/L1/L2/L3]]
 !! input
-[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
+[[../]]
 !! result
-<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a> same as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>.
+<p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
 </p>
-!!end
+!! end
+
 
 
 !! test
-Simple template in language variants
+Parents of subpages, two levels up
 !! options
-language=sr
+subpage title=[[Subpage test/L1/L2/L3]]
 !! input
-{{тест}}
+[[../../|L1]]2
+
+[[../../|L1]]l
 !! result
-<p>This is a test template
+<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
 
-
 !! test
-Template with explicit namespace in language variants
+Parents of subpages, two levels up, without trailing slash or name.
 !! options
-language=sr
+subpage title=[[Subpage test/L1/L2/L3]]
 !! input
-{{Template:тест}}
+[[../..]]
 !! result
-<p>This is a test template
+<p>[[../..]]
 </p>
 !! end
 
-
 !! test
-Basic test for template parameter in language variants
+Parents of subpages, two levels up, with lots of extra trailing slashes.
 !! options
-language=sr
+subpage title=[[Subpage test/L1/L2/L3]]
 !! input
-{{парамтест|param=foo}}
+[[../../////]]
 !! result
-<p>This is a test template with parameter foo
+<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)">///</a>
 </p>
 !! end
 
-
 !! test
-Simple category in language variants
-!! options
-language=sr cat
+Definition list code coverage
 !! input
-[[Category:МедиаWики Усер'с Гуиде]]
+; title   : def
+; title : def
+;title: def
 !! result
-<a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:MediaWiki_User%27s_Guide" title="Категорија:MediaWiki User's Guide">MediaWiki User's Guide</a>
+<dl><dt> title  &#160;</dt><dd> def
+</dd><dt> title&#160;</dt><dd> def
+</dd><dt>title</dt><dd> def
+</dd></dl>
+
 !! end
 
+!! test
+Don't fall for the self-closing div
+!! input
+<div>hello world</div/>
+!! result
+<div>hello world</div>
+
+!! end
 
 !! test
-Stripping -{}- tags (language variants)
-!! options
-language=sr
+MSGNW magic word
 !! input
-Latin proverb: -{Ne nuntium necare}-
+{{MSGNW:msg}}
 !! result
-<p>Latin proverb: Ne nuntium necare
+<p>&#91;&#91;:Template:Msg&#93;&#93;
 </p>
 !! end
 
-
 !! test
-Prevent conversion with -{}- tags (language variants)
-!! options
-language=sr variant=sr-ec
+RAW magic word
 !! input
-Latinski: -{Ne nuntium necare}-
+{{RAW:QUERTY}}
 !! result
-<p>Латински: Ne nuntium necare
+<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
 </p>
 !! end
 
-
+# This isn't needed for XHTML conformance, but would be handy as a fallback security measure
 !! test
-Prevent conversion of text with -{}- tags (language variants)
-!! options
-language=sr variant=sr-ec
+Always escape literal '>' in output, not just after '<'
 !! input
-Latinski: -{Ne nuntium necare}-
+><>
 !! result
-<p>Латински: Ne nuntium necare
+<p>&gt;&lt;&gt;
 </p>
 !! end
 
-
 !! test
-Prevent conversion of links with -{}- tags (language variants)
-!! options
-language=sr variant=sr-ec
+Template caching
 !! input
--{[[Main Page]]}-
+{{Test}}
+{{Test}}
 !! result
-<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+<p>This is a test template
+This is a test template
 </p>
 !! end
 
 
+!! article
+MediaWiki:Fake
+!! text
+==header==
+!! endarticle
+
 !! test
--{}- tags within headlines (within html for parserConvert())
-!! options
-language=sr variant=sr-ec
+Inclusion of !userCanEdit() content
 !! input
-== -{Naslov}- ==
+{{MediaWiki:Fake}}
 !! result
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a>]</span> <span class="mw-headline" id="header">header</span></h2>
 
 !! end
 
 
 !! test
-Explicit definition of language variant alternatives
-!! options
-language=zh variant=zh-tw
+Out-of-order TOC heading levels
 !! input
--{zh:China;zh-tw:Taiwan}-, not China
+==2==
+======6======
+===3===
+=1=
+=====5=====
+==2==
 !! result
-<p>Taiwan, not China
-</p>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
+<ul>
+<li class="toclevel-2 tocsection-2"><a href="#6"><span class="tocnumber">1.1</span> <span class="toctext">6</span></a></li>
+<li class="toclevel-2 tocsection-3"><a href="#3"><span class="tocnumber">1.2</span> <span class="toctext">3</span></a></li>
+</ul>
+</li>
+<li class="toclevel-1 tocsection-4"><a href="#1"><span class="tocnumber">2</span> <span class="toctext">1</span></a>
+<ul>
+<li class="toclevel-2 tocsection-5"><a href="#5"><span class="tocnumber">2.1</span> <span class="toctext">5</span></a></li>
+<li class="toclevel-2 tocsection-6"><a href="#2_2"><span class="tocnumber">2.2</span> <span class="toctext">2</span></a></li>
+</ul>
+</li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2">2</span></h2>
+<h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: 6">edit</a>]</span> <span class="mw-headline" id="6">6</span></h6>
+<h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 3">edit</a>]</span> <span class="mw-headline" id="3">3</span></h3>
+<h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: 1">edit</a>]</span> <span class="mw-headline" id="1">1</span></h1>
+<h5><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: 5">edit</a>]</span> <span class="mw-headline" id="5">5</span></h5>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2_2">2</span></h2>
+
 !! end
 
 
 !! test
-Explicit session-wise language variant mapping (A flag and - flag)
-!! options
-language=zh variant=zh-tw
+ISBN with a dummy number
 !! input
-Taiwan is not China.
-But -{A|zh:China;zh-tw:Taiwan}- is China,
-(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
-and -{China}- is China.
+ISBN ---
 !! result
-<p>Taiwan is not China.
-But Taiwan is Taiwan,
-(This should be stripped!)
-and China is China.
+<p>ISBN ---
 </p>
 !! end
 
+
 !! test
-Explicit session-wise language variant mapping (H flag for hide)
-!! options
-language=zh variant=zh-tw
+ISBN with space-delimited number
 !! input
-(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
-Taiwan is China.
+ISBN 92 9017 032 8
 !! result
-<p>(This should be stripped!)
-Taiwan is Taiwan.
+<p><a href="/wiki/Special:BookSources/9290170328" class="internal mw-magiclink-isbn">ISBN 92 9017 032 8</a>
 </p>
 !! end
 
+
 !! test
-Adding explicit conversion rule for title (T flag)
-!! options
-language=zh variant=zh-tw showtitle
+ISBN with multiple spaces, no number
 !! input
-Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
+ISBN  foo
 !! result
-Taiwan
-<p>Should be stripped!
+<p>ISBN  foo
 </p>
 !! end
 
+
 !! test
-Testing that changing the language variant here in the tests actually works
-!! options
-language=zh variant=zh showtitle
+ISBN length
 !! input
-Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
+ISBN 123456789
+
+ISBN 1234567890
+
+ISBN 12345678901
 !! result
-China
-<p>Should be stripped!
+<p>ISBN 123456789
+</p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
+</p><p>ISBN 12345678901
 </p>
 !! end
 
+
 !! test
-Bug 24072: more test on conversion rule for title
-!! options
-language=zh variant=zh-tw showtitle
+ISBN with trailing year (bug 8110)
 !! 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}-.
+ISBN 1-234-56789-0 - 2006
+
+ISBN 1 234 56789 0 - 2006
 !! result
-Taiwan
-<p>This should be stripped!
-This won't take interferes with the title rule.
+<p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1-234-56789-0</a> - 2006
+</p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1 234 56789 0</a> - 2006
 </p>
 !! end
 
+
 !! test
-Raw output of variant escape tags (R flag)
-!! options
-language=zh variant=zh-tw
+anchorencode
 !! input
-Raw: -{R|zh:China;zh-tw:Taiwan}-
+{{anchorencode:foo bar©#%n}}
 !! result
-<p>Raw: zh:China;zh-tw:Taiwan
+<p>foo_bar.C2.A9.23.25n
 </p>
 !! end
 
 !! test
-Nested using of manual convert syntax
-!! options
-language=zh variant=zh-hk
+anchorencode trims spaces
 !! input
-Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
+{{anchorencode: __pretty__please__}}
 !! result
-<p>Nested: Hello Hong Kong!
+<p>pretty_please
 </p>
 !! end
 
 !! test
-Do not convert roman numbers to language variants
-!! options
-language=sr variant=sr-ec
+anchorencode deals with links
 !! input
-Fridrih IV je car.
+{{anchorencode: [[hello|world]] [[hi]]}}
 !! result
-<p>Фридрих IV је цар.
+<p>world_hi
 </p>
 !! end
 
 !! test
-Unclosed language converter markup "-{"
-!! options 
-language=sr
+anchorencode deals with templates
 !! input
--{T|hello
+{{anchorencode: {{Foo}} }}
 !! result
-<p>-{T|hello
+<p>FOO
 </p>
 !! end
 
 !! test
-Don't convert raw rule "-{R|=&gt;}-" to "=>"
-!! options
-language=sr
+anchorencode encodes like the TOC generator: (bug 18431)
 !! input
--{R|=&gt;}-
-!! result 
-<p>=&gt;
+=== _ +:.3A%3A&&amp;]] ===
+{{anchorencode: _ +:.3A%3A&&amp;]] }}
+__NOEDITSECTION__
+!! result
+<h3> <span class="mw-headline" id=".2B:.3A.253A.26.26.5D.5D"> _ +:.3A%3A&amp;&amp;]] </span></h3>
+<p>.2B:.3A.253A.26.26.5D.5D
 </p>
-!!end
-
-!!article 
-Template:Bullet
-!!text
-* Bar
-!!endarticle
+!! 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 529: Uncovered bullet
+Bug 6200: blockquotes and paragraph formatting
 !! input
-* Foo {{bullet}}
-!! result
-<ul><li> Foo 
-</li><li> Bar
-</li></ul>
+<blockquote>
+foo
+</blockquote>
 
+bar
+
+ baz
+!! result
+<blockquote>
+foo
+</blockquote>
+<p>bar
+</p>
+<pre>baz
+</pre>
 !! end
 
 !! test
-Bug 529: Uncovered table already at line-start
+Bug 8293: Use of center tag ruins paragraph formatting
 !! input
-x
+<center>
+foo
+</center>
 
-{{table}}
-y
+bar
+
+ baz
 !! result
-<p>x
+<center>
+<p>foo
 </p>
-<table>
-<tr>
-<td> 1 </td>
-<td> 2
-</td></tr>
-<tr>
-<td> 3 </td>
-<td> 4
-</td></tr></table>
-<p>y
+</center>
+<p>bar
 </p>
+<pre>baz
+</pre>
 !! end
 
+
+###
+### Language variants related tests
+###
 !! test
-Bug 529: Uncovered bullet in parser function result
+Self-link in language variants
+!! options
+title=[[Dunav]] language=sr
 !! input
-* Foo {{lc:{{bullet}} }}
+Both [[Dunav]] and [[Дунав]] are names for this river.
 !! result
-<ul><li> Foo 
-</li><li> bar
-</li></ul>
+<p>Both <strong class="selflink">Dunav</strong> and <strong class="selflink">Дунав</strong> are names for this river.
+</p>
+!!end
 
-!! end
 
 !! test
-Bug 5678: Double-parsed template argument
+Link to pages in language variants
+!! options
+language=sr
 !! input
-{{lc:{{{1}}}|hello}}
+Main Page can be written as [[Маин Паге]]
 !! result
-<p>{{{1}}}
+<p>Main Page can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>
 </p>
-!! end
+!!end
+
 
 !! test
-Bug 5678: Double-parsed template invocation
+Multiple links to pages in language variants
+!! options
+language=sr
 !! input
-{{lc:{{paramtest {{!}} param = hello }} }}
+[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
 !! result
-<p>{{paramtest | param = hello }}
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a> same as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>.
 </p>
-!! end
+!!end
+
 
 !! test
-Case insensitivity of parser functions for non-ASCII characters (bug 8143)
+Simple template in language variants
 !! options
-language=cs
-title=[[Main Page]]
+language=sr
 !! input
-{{PRVNÍVELKÉ:ěščř}}
-{{prvnívelké:ěščř}}
-{{PRVNÍMALÉ:ěščř}}
-{{prvnímalé:ěščř}}
-{{MALÁ:ěščř}}
-{{malá:ěščř}}
-{{VELKÁ:ěščř}}
-{{velká:ěščř}}
+{{тест}}
 !! result
-<p>Ěščř
-Ěščř
-ěščř
-ěščř
-ěščř
-ěščř
-ĚŠČŘ
-ĚŠČŘ
+<p>This is a test template
 </p>
 !! end
 
+
 !! test
-Morwen/13: Unclosed link followed by heading
+Template with explicit namespace in language variants
+!! options
+language=sr
 !! input
-[[link
-==heading==
+{{Template:тест}}
 !! result
-<p>[[link
+<p>This is a test template
 </p>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
-
 !! end
 
+
 !! test
-HHP2.1: Heuristics for headings in preprocessor parenthetical structures
+Basic test for template parameter in language variants
+!! options
+language=sr
 !! input
-{{foo|
-=heading=
+{{парамтест|param=foo}}
 !! result
-<p>{{foo|
+<p>This is a test template with parameter foo
 </p>
-<h1> <span class="mw-headline" id="heading">heading</span></h1>
-
 !! end
 
+
 !! test
-HHP2.2: Heuristics for headings in preprocessor parenthetical structures
+Simple category in language variants
+!! options
+language=sr cat
 !! input
-{{foo|
-==heading==
+[[Category:МедиаWики Усер'с Гуиде]]
 !! result
-<p>{{foo|
-</p>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
-
+<a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:MediaWiki_User%27s_Guide" title="Категорија:MediaWiki User's Guide">MediaWiki User's Guide</a>
 !! end
 
+
 !! test
-Tildes in comments
+Stripping -{}- tags (language variants)
 !! options
-pst
+language=sr
 !! input
-<!-- ~~~~ -->
+Latin proverb: -{Ne nuntium necare}-
 !! result
-<!-- ~~~~ -->
+<p>Latin proverb: Ne nuntium necare
+</p>
 !! end
 
+
 !! test
-Paragraphs inside divs (no extra line breaks)
+Prevent conversion with -{}- tags (language variants)
+!! options
+language=sr variant=sr-ec
 !! input
-<div>Line one
-
-Line two</div>
+Latinski: -{Ne nuntium necare}-
 !! result
-<div>Line one
-Line two</div>
-
+<p>Латински: Ne nuntium necare
+</p>
 !! end
 
+
 !! test
-Paragraphs inside divs (extra line break on open)
+Prevent conversion of text with -{}- tags (language variants)
+!! options
+language=sr variant=sr-ec
 !! input
-<div>
-Line one
-
-Line two</div>
+Latinski: -{Ne nuntium necare}-
 !! result
-<div>
-<p>Line one
+<p>Латински: Ne nuntium necare
 </p>
-Line two</div>
-
 !! end
 
+
 !! test
-Paragraphs inside divs (extra line break on close)
+Prevent conversion of links with -{}- tags (language variants)
+!! options
+language=sr variant=sr-ec
 !! input
-<div>Line one
-
-Line two
-</div>
+-{[[Main Page]]}-
 !! result
-<div>Line one
-<p>Line two
+<p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 </p>
-</div>
-
 !! end
 
+
 !! test
-Paragraphs inside divs (extra line break on open and close)
+-{}- tags within headlines (within html for parserConvert())
+!! options
+language=sr variant=sr-ec
 !! input
-<div>
-Line one
+== -{Naslov}- ==
+!! result
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
+
+!! end
 
-Line two
-</div>
+
+!! test
+Explicit definition of language variant alternatives
+!! options
+language=zh variant=zh-tw
+!! input
+-{zh:China;zh-tw:Taiwan}-, not China
 !! result
-<div>
-<p>Line one
-</p><p>Line two
+<p>Taiwan, not China
 </p>
-</div>
-
 !! end
 
+
 !! test
-Nesting tags, paragraphs on lines which begin with <div>
+Explicit session-wise language variant mapping (A flag and - flag)
 !! options
-disabled
+language=zh variant=zh-tw
 !! input
-<div></div><strong>A
-B</strong>
+Taiwan is not China.
+But -{A|zh:China;zh-tw:Taiwan}- is China,
+(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
+and -{China}- is China.
 !! result
-<div></div>
-<p><strong>A
-B</strong>
+<p>Taiwan is not China.
+But Taiwan is Taiwan,
+(This should be stripped!)
+and China is China.
 </p>
 !! end
 
-# Bug 6200: <blockquote> should behave like <div> with respect to line breaks
 !! test
-Bug 6200: paragraphs inside blockquotes (no extra line breaks)
+Explicit session-wise language variant mapping (H flag for hide)
 !! options
-disabled
+language=zh variant=zh-tw
 !! input
-<blockquote>Line one
-
-Line two</blockquote>
+(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
+Taiwan is China.
 !! result
-<blockquote>Line one
-Line two</blockquote>
-
+<p>(This should be stripped!)
+Taiwan is Taiwan.
+</p>
 !! end
 
 !! test
-Bug 6200: paragraphs inside blockquotes (extra line break on open)
+Adding explicit conversion rule for title (T flag)
 !! options
-disabled
+language=zh variant=zh-tw showtitle
 !! input
-<blockquote>
-Line one
-
-Line two</blockquote>
+Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 !! result
-<blockquote>
-<p>Line one
+Taiwan
+<p>Should be stripped!
 </p>
-Line two</blockquote>
-
 !! end
 
 !! test
-Bug 6200: paragraphs inside blockquotes (extra line break on close)
+Testing that changing the language variant here in the tests actually works
 !! options
-disabled
+language=zh variant=zh showtitle
 !! input
-<blockquote>Line one
-
-Line two
-</blockquote>
+Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
 !! result
-<blockquote>Line one
-<p>Line two
+China
+<p>Should be stripped!
 </p>
-</blockquote>
-
 !! end
 
 !! test
-Bug 6200: paragraphs inside blockquotes (extra line break on open and close)
+Bug 24072: more test on conversion rule for title
 !! options
-disabled
+language=zh variant=zh-tw showtitle
 !! input
-<blockquote>
-Line one
-
-Line two
-</blockquote>
+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
-<blockquote>
-<p>Line one
-</p><p>Line two
+Taiwan
+<p>This should be stripped!
+This won't take interferes with the title rule.
 </p>
-</blockquote>
-
 !! end
 
 !! test
-Paragraphs inside blockquotes/divs (no extra line breaks)
+Raw output of variant escape tags (R flag)
+!! options
+language=zh variant=zh-tw
 !! input
-<blockquote><div>Line one
-
-Line two</div></blockquote>
+Raw: -{R|zh:China;zh-tw:Taiwan}-
 !! result
-<blockquote><div>Line one
-Line two</div></blockquote>
-
+<p>Raw: zh:China;zh-tw:Taiwan
+</p>
 !! end
 
 !! test
-Paragraphs inside blockquotes/divs (extra line break on open)
+Nested using of manual convert syntax
+!! options
+language=zh variant=zh-hk
 !! input
-<blockquote><div>
-Line one
-
-Line two</div></blockquote>
+Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
 !! result
-<blockquote><div>
-<p>Line one
+<p>Nested: Hello Hong Kong!
 </p>
-Line two</div></blockquote>
-
 !! end
 
 !! test
-Paragraphs inside blockquotes/divs (extra line break on close)
+Do not convert roman numbers to language variants
+!! options
+language=sr variant=sr-ec
 !! input
-<blockquote><div>Line one
-
-Line two
-</div></blockquote>
+Fridrih IV je car.
 !! result
-<blockquote><div>Line one
-<p>Line two
+<p>Фридрих IV је цар.
 </p>
-</div></blockquote>
-
 !! end
 
 !! test
-Paragraphs inside blockquotes/divs (extra line break on open and close)
+Unclosed language converter markup "-{"
+!! options 
+language=sr
 !! input
-<blockquote><div>
-Line one
-
-Line two
-</div></blockquote>
+-{T|hello
 !! result
-<blockquote><div>
-<p>Line one
-</p><p>Line two
+<p>-{T|hello
 </p>
-</div></blockquote>
-
 !! end
 
 !! test
-Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion
+Don't convert raw rule "-{R|=&gt;}-" to "=>"
 !! options
-wgLinkHolderBatchSize=0
+language=sr
 !! input
-[[meatball:1]]
-[[meatball:2]]
-[[meatball:3]]
-!! result
-<p><a href="http://www.usemod.com/cgi-bin/mb.pl?1" class="extiw" title="meatball:1">meatball:1</a>
-<a href="http://www.usemod.com/cgi-bin/mb.pl?2" class="extiw" title="meatball:2">meatball:2</a>
-<a href="http://www.usemod.com/cgi-bin/mb.pl?3" class="extiw" title="meatball:3">meatball:3</a>
+-{R|=&gt;}-
+!! result 
+<p>=&gt;
 </p>
-!! end
+!!end
+
+!!article 
+Template:Bullet
+!!text
+* Bar
+!!endarticle
 
 !! test
-Free external link invading image caption
+Bug 529: Uncovered bullet
 !! input
-[[Image:Foobar.jpg|thumb|http://x|hello]]
+* Foo {{bullet}}
 !! 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/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>
+<ul><li> Foo 
+</li><li> Bar
+</li></ul>
 
 !! end
 
 !! test
-Bug 15196: localised external link numbers
-!! options
-language=fa
+Bug 529: Uncovered table already at line-start
 !! input
-[http://en.wikipedia.org/]
+x
+
+{{table}}
+y
 !! result
-<p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
+<p>x
+</p>
+<table>
+<tr>
+<td> 1 </td>
+<td> 2
+</td></tr>
+<tr>
+<td> 3 </td>
+<td> 4
+</td></tr></table>
+<p>y
 </p>
 !! end
 
 !! test
-Multibyte character in padleft
+Bug 529: Uncovered bullet in parser function result
 !! input
-{{padleft:-Hello|7|Æ}}
+* Foo {{lc:{{bullet}} }}
 !! result
-<p>Æ-Hello
-</p>
+<ul><li> Foo 
+</li><li> bar
+</li></ul>
+
 !! end
 
 !! test
-Multibyte character in padright
+Bug 5678: Double-parsed template argument
 !! input
-{{padright:Hello-|7|Æ}}
+{{lc:{{{1}}}|hello}}
 !! result
-<p>Hello-Æ
+<p>{{{1}}}
 </p>
 !! end
 
 !! test
-Formatted date
-!! config
-wgUseDynamicDates=1
+Bug 5678: Double-parsed template invocation
 !! input
-[[2009-03-24]]
+{{lc:{{paramtest {{!}} param = hello }} }}
 !! result
-<p><span class="mw-formatted-date" title="2009-03-24"><a href="/index.php?title=2009&amp;action=edit&amp;redlink=1" class="new" title="2009 (page does not exist)">2009</a>-<a href="/index.php?title=March_24&amp;action=edit&amp;redlink=1" class="new" title="March 24 (page does not exist)">03-24</a></span>
+<p>{{paramtest | param = hello }}
 </p>
-!!end
+!! end
 
-!!test
-formatdate parser function
-!!input
-{{#formatdate:2009-03-24}}
+!! test
+Case insensitivity of parser functions for non-ASCII characters (bug 8143)
+!! options
+language=cs
+title=[[Main Page]]
+!! input
+{{PRVNÍVELKÉ:ěščř}}
+{{prvnívelké:ěščř}}
+{{PRVNÍMALÉ:ěščř}}
+{{prvnímalé:ěščř}}
+{{MALÁ:ěščř}}
+{{malá:ěščř}}
+{{VELKÁ:ěščř}}
+{{velká:ěščř}}
 !! result
-<p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
+<p>Ěščř
+Ěščř
+ěščř
+ěščř
+ěščř
+ěščř
+ĚŠČŘ
+ĚŠČŘ
 </p>
 !! end
 
-!!test
-formatdate parser function, with default format
-!!input
-{{#formatdate:2009-03-24|mdy}}
+!! test
+Morwen/13: Unclosed link followed by heading
+!! input
+[[link
+==heading==
 !! result
-<p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
+<p>[[link
 </p>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
+
 !! end
 
 !! test
-Linked date with autoformatting disabled
-!! config
-wgUseDynamicDates=false
+HHP2.1: Heuristics for headings in preprocessor parenthetical structures
 !! input
-[[2009-03-24]]
+{{foo|
+=heading=
 !! result
-<p><a href="/index.php?title=2009-03-24&amp;action=edit&amp;redlink=1" class="new" title="2009-03-24 (page does not exist)">2009-03-24</a>
+<p>{{foo|
 </p>
+<h1> <span class="mw-headline" id="heading">heading</span></h1>
+
 !! end
 
 !! test
-Spacing of numbers in formatted dates
+HHP2.2: Heuristics for headings in preprocessor parenthetical structures
 !! input
-{{#formatdate:January 15}}
+{{foo|
+==heading==
 !! result
-<p><span class="mw-formatted-date" title="01-15">January 15</span>
+<p>{{foo|
 </p>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
+
 !! end
 
 !! test
-Spacing of numbers in formatted dates (linked)
-!! config
-wgUseDynamicDates=true
+Tildes in comments
+!! options
+pst
 !! input
-[[January 15]]
+<!-- ~~~~ -->
 !! result
-<p><span class="mw-formatted-date" title="01-15"><a href="/index.php?title=January_15&amp;action=edit&amp;redlink=1" class="new" title="January 15 (page does not exist)">January 15</a></span>
-</p>
+<!-- ~~~~ -->
 !! end
 
-#
-#
-#
-
-#
-# Edit comments
-#
-
 !! test
-Edit comment with link
-!! options
-comment
+Paragraphs inside divs (no extra line breaks)
 !! input
-I like the [[Main Page]] a lot
+<div>Line one
+
+Line two</div>
 !! result
-I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
-!!end
+<div>Line one
+Line two</div>
+
+!! end
 
 !! test
-Edit comment with link and link text
-!! options
-comment
+Paragraphs inside divs (extra line break on open)
 !! input
-I like the [[Main Page|best pages]] a lot
+<div>
+Line one
+
+Line two</div>
 !! result
-I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
-!!end
+<div>
+<p>Line one
+</p>
+Line two</div>
+
+!! end
 
 !! test
-Edit comment with link and link text with suffix
-!! options
-comment
+Paragraphs inside divs (extra line break on close)
 !! input
-I like the [[Main Page|best page]]s a lot
+<div>Line one
+
+Line two
+</div>
 !! result
-I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
-!!end
+<div>Line one
+<p>Line two
+</p>
+</div>
+
+!! end
 
 !! test
-Edit comment with section link (non-local, eg in history list)
-!! options
-comment title=[[Main Page]]
+Paragraphs inside divs (extra line break on open and close)
 !! input
-/* External links */ removed bogus entries
+<div>
+Line one
+
+Line two
+</div>
 !! result
-<a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
-!!end
+<div>
+<p>Line one
+</p><p>Line two
+</p>
+</div>
+
+!! end
 
 !! test
-Edit comment with section link and text before it (non-local, eg in history list)
+Nesting tags, paragraphs on lines which begin with <div>
 !! options
-comment title=[[Main Page]]
+disabled
 !! input
-pre-comment text /* External links */ removed bogus entries
+<div></div><strong>A
+B</strong>
 !! result
-pre-comment text - <a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
-!!end
+<div></div>
+<p><strong>A
+B</strong>
+</p>
+!! end
 
+# Bug 6200: <blockquote> should behave like <div> with respect to line breaks
 !! test
-Edit comment with section link (local, eg in diff view)
+Bug 6200: paragraphs inside blockquotes (no extra line breaks)
 !! options
-comment local title=[[Main Page]]
+disabled
 !! input
-/* External links */ removed bogus entries
+<blockquote>Line one
+
+Line two</blockquote>
 !! result
-<a href="#External_links">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
-!!end
+<blockquote>Line one
+Line two</blockquote>
+
+!! end
 
 !! test
-Edit comment with subpage link (bug 14080)
+Bug 6200: paragraphs inside blockquotes (extra line break on open)
 !! options
-comment
-subpage
-title=[[Subpage test]]
+disabled
 !! input
-Poked at a [[/subpage]] here...
+<blockquote>
+Line one
+
+Line two</blockquote>
 !! result
-Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a> here...
-!!end
+<blockquote>
+<p>Line one
+</p>
+Line two</blockquote>
+
+!! end
 
 !! test
-Edit comment with subpage link and link text (bug 14080)
+Bug 6200: paragraphs inside blockquotes (extra line break on close)
 !! options
-comment
-subpage
-title=[[Subpage test]]
+disabled
 !! input
-Poked at a [[/subpage|neat little page]] here...
+<blockquote>Line one
+
+Line two
+</blockquote>
 !! result
-Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">neat little page</a> here...
-!!end
+<blockquote>Line one
+<p>Line two
+</p>
+</blockquote>
+
+!! end
 
 !! test
-Edit comment with bogus subpage link in non-subpage NS (bug 14080)
+Bug 6200: paragraphs inside blockquotes (extra line break on open and close)
 !! options
-comment
-title=[[Subpage test]]
+disabled
 !! input
-Poked at a [[/subpage]] here...
+<blockquote>
+Line one
+
+Line two
+</blockquote>
 !! result
-Poked at a <a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
-!!end
+<blockquote>
+<p>Line one
+</p><p>Line two
+</p>
+</blockquote>
+
+!! end
 
 !! test
-Edit comment with bare anchor link (local, as on diff)
-!! options
-comment
-local
-title=[[Main Page]]
-!!input
-[[#section]]
+Paragraphs inside blockquotes/divs (no extra line breaks)
+!! input
+<blockquote><div>Line one
+
+Line two</div></blockquote>
 !! result
-<a href="#section">#section</a>
+<blockquote><div>Line one
+Line two</div></blockquote>
+
 !! end
 
 !! test
-Edit comment with bare anchor link (non-local, as on history)
-!! options
-comment
-title=[[Main Page]]
-!!input
-[[#section]]
+Paragraphs inside blockquotes/divs (extra line break on open)
+!! input
+<blockquote><div>
+Line one
+
+Line two</div></blockquote>
 !! result
-<a href="/wiki/Main_Page#section" title="Main Page">#section</a>
+<blockquote><div>
+<p>Line one
+</p>
+Line two</div></blockquote>
+
 !! end
 
 !! test
-Anchor starting with underscore
-!!input
-[[#_ref|One]]
+Paragraphs inside blockquotes/divs (extra line break on close)
+!! input
+<blockquote><div>Line one
+
+Line two
+</div></blockquote>
 !! result
-<p><a href="#_ref">One</a>
+<blockquote><div>Line one
+<p>Line two
 </p>
+</div></blockquote>
+
 !! end
 
 !! test
-Id starting with underscore
-!!input
-<div id="_ref"></div>
+Paragraphs inside blockquotes/divs (extra line break on open and close)
+!! input
+<blockquote><div>
+Line one
+
+Line two
+</div></blockquote>
 !! result
-<div id="_ref"></div>
+<blockquote><div>
+<p>Line one
+</p><p>Line two
+</p>
+</div></blockquote>
 
 !! end
 
 !! test
-Space normalisation on autocomment (bug 22784)
+Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion
 !! options
-comment
-title=[[Main Page]]
-!!input
-/* __hello__world__ */
+wgLinkHolderBatchSize=0
+!! input
+[[meatball:1]]
+[[meatball:2]]
+[[meatball:3]]
 !! result
-<a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">__hello__world__</span></span>
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?1" class="extiw" title="meatball:1">meatball:1</a>
+<a href="http://www.usemod.com/cgi-bin/mb.pl?2" class="extiw" title="meatball:2">meatball:2</a>
+<a href="http://www.usemod.com/cgi-bin/mb.pl?3" class="extiw" title="meatball:3">meatball:3</a>
+</p>
 !! end
 
 !! test
-percent-encoding and + signs in comments (Bug 26410)
-!! options
-comment
-!!input
-[[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
+Free external link invading image caption
+!! input
+[[Image:Foobar.jpg|thumb|http://x|hello]]
 !! result
-<a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
+<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
 
 !! test
-Bad images - basic functionality
+Bug 15196: localised external link numbers
 !! options
-disabled
+language=fa
 !! input
-[[File:Bad.jpg]]
+[http://en.wikipedia.org/]
 !! result
+<p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
+</p>
 !! end
 
 !! test
-Bad images - bug 16039: text after bad image disappears
-!! options
-disabled
+Multibyte character in padleft
 !! input
-Foo bar
-[[File:Bad.jpg]]
-Bar foo
+{{padleft:-Hello|7|Æ}}
 !! result
-<p>Foo bar
-</p><p>Bar foo
+<p>Æ-Hello
 </p>
 !! end
 
 !! test
-Verify that displaytitle works (bug #22501) no displaytitle
-!! options
-showtitle
-!! config
-wgAllowDisplayTitle=true
-wgRestrictDisplayTitle=false
+Multibyte character in padright
 !! input
-this is not the the title
+{{padright:Hello-|7|Æ}}
 !! result
-Parser test
-<p>this is not the the title
+<p>Hello-Æ
 </p>
 !! end
 
 !! test
-Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false
-!! options
-showtitle
-title=[[Screen]]
+Formatted date
 !! config
-wgAllowDisplayTitle=true
-wgRestrictDisplayTitle=false
+wgUseDynamicDates=1
 !! input
-this is not the the title
-{{DISPLAYTITLE:whatever}}
+[[2009-03-24]]
 !! result
-whatever
-<p>this is not the the title
+<p><span class="mw-formatted-date" title="2009-03-24"><a href="/index.php?title=2009&amp;action=edit&amp;redlink=1" class="new" title="2009 (page does not exist)">2009</a>-<a href="/index.php?title=March_24&amp;action=edit&amp;redlink=1" class="new" title="March 24 (page does not exist)">03-24</a></span>
+</p>
+!!end
+
+!!test
+formatdate parser function
+!!input
+{{#formatdate:2009-03-24}}
+!! result
+<p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
 </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}}
+!!test
+formatdate parser function, with default format
+!!input
+{{#formatdate:2009-03-24|mdy}}
 !! result
-Screen
-<p>this is not the the title
+<p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
 </p>
 !! end
 
 !! test
-Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
-!! options
-showtitle
-title=[[Screen]]
+Linked date with autoformatting disabled
 !! config
-wgAllowDisplayTitle=true
-wgRestrictDisplayTitle=true
+wgUseDynamicDates=false
 !! input
-this is not the the title
-{{DISPLAYTITLE:screen}}
+[[2009-03-24]]
 !! result
-screen
-<p>this is not the the title
+<p><a href="/index.php?title=2009-03-24&amp;action=edit&amp;redlink=1" class="new" title="2009-03-24 (page does not exist)">2009-03-24</a>
 </p>
 !! end
 
 !! test
-Verify that displaytitle works (bug #22501) AllowDisplayTitle=false
-!! options
-showtitle
-title=[[Screen]]
-!! config
-wgAllowDisplayTitle=false
+Spacing of numbers in formatted dates
 !! input
-this is not the the title
-{{DISPLAYTITLE:screen}}
+{{#formatdate:January 15}}
 !! 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><span class="mw-formatted-date" title="01-15">January 15</span>
 </p>
 !! end
 
 !! test
-Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE
-!! options
-showtitle
-title=[[Screen]]
+Spacing of numbers in formatted dates (linked)
 !! config
-wgAllowDisplayTitle=false
+wgUseDynamicDates=true
 !! input
-this is not the the title
+[[January 15]]
 !! result
-Screen
-<p>this is not the the title
+<p><span class="mw-formatted-date" title="01-15"><a href="/index.php?title=January_15&amp;action=edit&amp;redlink=1" class="new" title="January 15 (page does not exist)">January 15</a></span>
 </p>
 !! end
+
+#
+#
+#
+
+#
+# Edit comments
+#
+
 !! test
-preload: check <noinclude> and <includeonly>
+Edit comment with link
 !! options
-preload
+comment
 !! input
-Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
+I like the [[Main Page]] a lot
 !! result
-Hello kind world.
-!! end
+I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
+!!end
+
 !! test
-preload: check <onlyinclude>
+Edit comment with link and link text
 !! options
-preload
+comment
 !! input
-Goodbye <onlyinclude>Hello world</onlyinclude>
+I like the [[Main Page|best pages]] a lot
 !! result
-Hello world
-!! end
+I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
+!!end
 
 !! test
-preload: can pass tags through if we want to
+Edit comment with link and link text with suffix
 !! options
-preload
+comment
 !! input
-<includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
+I like the [[Main Page|best page]]s a lot
 !! result
-<includeonly>Hello world</includeonly>
-!! end
+I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
+!!end
 
 !! test
-preload: check that it doesn't try to do tricks
+Edit comment with section link (non-local, eg in history list)
 !! options
-preload
+comment title=[[Main Page]]
 !! input
-* <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
+/* External links */ removed bogus entries
 !! result
-* <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
-!! end
+<a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
+!!end
 
 !! test
-Play a bit with r67090 and bug 3158 
+Edit comment with section link and text before it (non-local, eg in history list)
 !! options
-disabled
+comment title=[[Main Page]]
 !! input
-<div style="width:50% !important">&nbsp;</div>
-<div style="width:50%&nbsp;!important">&nbsp;</div>
-<div style="width:50%&#160;!important">&nbsp;</div>
-<div style="border : solid;">&nbsp;</div>
+pre-comment text /* External links */ removed bogus entries
 !! result
-<div style="width:50% !important">&nbsp;</div>
-<div style="width:50% !important">&nbsp;</div>
-<div style="width:50% !important">&nbsp;</div>
-<div style="border&#160;: solid;">&nbsp;</div>
-
-!! end
+pre-comment text - <a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
+!!end
 
 !! test
-HTML5 data attributes
+Edit comment with section link (local, eg in diff view)
+!! options
+comment local title=[[Main Page]]
 !! input
-<span data-foo="bar">Baz</span>
-<p data-abc-def_hij="">Quuz</p>
+/* External links */ removed bogus entries
 !! result
-<p><span data-foo="bar">Baz</span>
-</p>
-<p data-abc-def_hij="">Quuz</p>
-
-!! end
+<a href="#External_links">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
+!!end
 
 !! test
-percent-encoding and + signs in internal links (Bug 26410)
-!! input
-[[User:+%]] [[Page+title%]]
-[[%+]] [[%+|%20]] [[%+ ]] [[%+r]]
-[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
-[[%33%45]] [[%33%45+]]
-!! result
-<p><a href="/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
-<a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
-<a href="/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
-<a href="/index.php?title=3E&amp;action=edit&amp;redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="/index.php?title=3E%2B&amp;action=edit&amp;redlink=1" class="new" title="3E+ (page does not exist)">3E+</a>
-</p>
-!! end
+Edit comment with subpage link (bug 14080)
+!! options
+comment
+subpage
+title=[[Subpage test]]
+!! input
+Poked at a [[/subpage]] here...
+!! result
+Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a> here...
+!!end
 
 !! test
-Special characters in embedded file links (bug 27679)
+Edit comment with subpage link and link text (bug 14080)
+!! options
+comment
+subpage
+title=[[Subpage test]]
 !! input
-[[File:Contains & ampersand.jpg]]
-[[File:Does not exist.jpg|Title with & ampersand]]
+Poked at a [[/subpage|neat little page]] here...
 !! result
-<p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
-<a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
-</p>
-!! end
-
+Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">neat little page</a> here...
+!!end
 
 !! test
-Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
+Edit comment with bogus subpage link in non-subpage NS (bug 14080)
+!! options
+comment
+title=[[Subpage test]]
 !! input
-Text&apos;s been normalized?
+Poked at a [[/subpage]] here...
 !! result
-<p>Text&#39;s been normalized?
-</p>
-!! end
+Poked at a <a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
+!!end
 
 !! test
-Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
-!! input
-http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
+Edit comment with bare anchor link (local, as on diff)
+!! options
+comment
+local
+title=[[Main Page]]
+!!input
+[[#section]]
 !! result
-<p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> &lt;-- U+3000 (vim: ^Vu3000)
-</p>
+<a href="#section">#section</a>
 !! end
 
 !! test
-Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
-!! input
-[http://www.example.org/ ideograms]
+Edit comment with bare anchor link (non-local, as on history)
+!! options
+comment
+title=[[Main Page]]
+!!input
+[[#section]]
 !! result
-<p><a rel="nofollow" class="external text" href="http://www.example.org/">ideograms</a>
-</p>
+<a href="/wiki/Main_Page#section" title="Main Page">#section</a>
 !! end
 
 !! test
-Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links
-!! input
-http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
+Anchor starting with underscore
+!!input
+[[#_ref|One]]
 !! result
-<p><img src="http://www.example.org/pic.png" alt="pic.png" /> &lt;-- U+3000 (vim: ^Vu3000)
+<p><a href="#_ref">One</a>
 </p>
 !! end
 
-!! article
-Mediawiki:loop1
-!! text
-{{Identical|A}}
-!! endarticle
-
-!! article
-Mediawiki:loop2
-!! text
-{{Identical|B}}
-!! endarticle
-
-!! article
-Template:Identical
-!! text
-{{int:loop1}}
-{{int:loop2}}
-!! endarticle
-
 !! test
-Bug 31098 Template which includes system messages which includes the template
-!! input
-{{Identical}}
+Id starting with underscore
+!!input
+<div id="_ref"></div>
 !! result
-<p><span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
-<span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
-</p>
+<div id="_ref"></div>
+
 !! end
 
 !! test
-Deprecated presentational attributes are converted to css
-!! input
-{|
-| valign=top align=left width=100 height=25% | Asdf
-|}
-<ul type="disc"></ul>
+Space normalisation on autocomment (bug 22784)
+!! options
+comment
+title=[[Main Page]]
+!!input
+/* __hello__world__ */
 !! result
-<table>
-<tr>
-<td style="text-align: left; height: 25%; vertical-align: top; width: 100px;"> Asdf
-</td></tr></table>
-<ul style="list-style-type: disc;"></ul>
-
+<a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">__hello__world__</span></span>
 !! end
 
 !! test
-Bug31490 Turkish: ucfirst 'blah'
+percent-encoding and + signs in comments (Bug 26410)
 !! options
-language=tr
-!! input
-{{ucfirst:blah}}
+comment
+!!input
+[[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
 !! result
-<p>Blah
-</p>
+<a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
 !! end
 
 !! test
-Bug31490 Turkish: ucfirst 'ix'
+Bad images - basic functionality
 !! options
-language=tr
+disabled
 !! input
-{{ucfirst:ix}}
+[[File:Bad.jpg]]
 !! result
-<p>İx
-</p>
 !! end
 
 !! test
-Bug31490 Turkish: lcfirst 'BLAH'
+Bad images - bug 16039: text after bad image disappears
 !! options
-language=tr
+disabled
 !! input
-{{lcfirst:BLAH}}
+Foo bar
+[[File:Bad.jpg]]
+Bar foo
 !! result
-<p>bLAH
+<p>Foo bar
+</p><p>Bar foo
 </p>
 !! end
 
 !! test
-Bug31490 Turkish: ucfırst (with a dotless i)
+Verify that displaytitle works (bug #22501) no displaytitle
 !! options
-language=tr
+showtitle
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
 !! input
-{{ucfırst:blah}}
+this is not the the title
 !! result
-<p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
+Parser test
+<p>this is not the the title
 </p>
 !! end
 
 !! test
-Bug31490 ucfırst (with a dotless i) with English language
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false
 !! options
-language=en
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=false
 !! input
-{{ucfırst:blah}}
+this is not the the title
+{{DISPLAYTITLE:whatever}}
 !! result
-<p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
+whatever
+<p>this is not the the title
 </p>
 !! end
 
 !! test
-Bug 26375: TOC with italics
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch
 !! options
-title=[[Main Page]]
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
 !! input
-__TOC__
-== ''Lost'' episodes ==
+this is not the the title
+{{DISPLAYTITLE:whatever}}
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Lost episodes">edit</a>]</span> <span class="mw-headline" id="Lost_episodes"> <i>Lost</i> episodes </span></h2>
-
+Screen
+<p>this is not the the title
+</p>
 !! end
 
 !! test
-Bug 26375: TOC with bold 
+Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
 !! options
-title=[[Main Page]]
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=true
+wgRestrictDisplayTitle=true
 !! input
-__TOC__
-== '''should be bold''' then normal text ==
+this is not the the title
+{{DISPLAYTITLE:screen}}
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: should be bold then normal text">edit</a>]</span> <span class="mw-headline" id="should_be_bold_then_normal_text"> <b>should be bold</b> then normal text </span></h2>
-
+screen
+<p>this is not the the title
+</p>
 !! end
 
 !! test
-Bug 33845: Headings become cursive in TOC when they contain an image
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false
 !! options
-title=[[Main Page]]
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
 !! input
-__TOC__
-== Image [[Image:foobar.jpg]] ==
+this is not the the title
+{{DISPLAYTITLE:screen}}
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Image">edit</a>]</span> <span class="mw-headline" id="Image"> Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </span></h2>
-
+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
-Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
+Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE
 !! options
-title=[[Main Page]]
+showtitle
+title=[[Screen]]
+!! config
+wgAllowDisplayTitle=false
 !! input
-__TOC__
-== <blockquote>Quote</blockquote> ==
-!! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Quote">edit</a>]</span> <span class="mw-headline" id="Quote"> <blockquote>Quote</blockquote> </span></h2>
-
+this is not the the title
+!! result
+Screen
+<p>this is not the the title
+</p>
 !! end
-
 !! test
-Unclosed tags in TOC
+preload: check <noinclude> and <includeonly>
 !! options
-title=[[Main Page]]
+preload
 !! input
-__TOC__
-== Proof: 2 < 3 ==
-<small>Hanc marginis exiguitas non caperet.</small>
-QED
+Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 &lt; 3</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Proof: 2 &lt; 3">edit</a>]</span> <span class="mw-headline" id="Proof:_2_.3C_3"> Proof: 2 &lt; 3 </span></h2>
-<p><small>Hanc marginis exiguitas non caperet.</small>
-QED
-</p>
+Hello kind world.
 !! end
-
 !! test
-Multiple tags in TOC
+preload: check <onlyinclude>
+!! options
+preload
 !! input
-__TOC__
-== <i>Foo</i> <b>Bar</b> ==
-
-== <i>Foo</i> <blockquote>Bar</blockquote> ==
+Goodbye <onlyinclude>Hello world</onlyinclude>
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
-<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar"> <i>Foo</i> <b>Bar</b> </span></h2>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> <i>Foo</i> <blockquote>Bar</blockquote> </span></h2>
-
+Hello world
 !! end
 
 !! test
-Tags with parameters in TOC
+preload: can pass tags through if we want to
+!! options
+preload
 !! input
-__TOC__
-== <sup class="in-h2">Hello</sup> ==
-
-== <sup class="a > b">Evilbye</sup> ==
+<includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
 !! result
-<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#Hello"><span class="tocnumber">1</span> <span class="toctext"><sup>Hello</sup></span></a></li>
-<li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b"&gt;Evilbye</sup></span></a></li>
-</ul>
-</td></tr></table>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Hello">edit</a>]</span> <span class="mw-headline" id="Hello"> <sup class="in-h2">Hello</sup> </span></h2>
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: b&quot;>Evilbye">edit</a>]</span> <span class="mw-headline" id="b.22.3EEvilbye"> <sup> b"&gt;Evilbye</sup> </span></h2>
-
+<includeonly>Hello world</includeonly>
 !! end
 
-!! article
-MediaWiki:Bug32057
-!! text
-== {{int:headline_sample}} ==
-!! endarticle
-
 !! test
-Bug 32057: Title needed when expanding <h> nodes.
+preload: check that it doesn't try to do tricks
 !! options
-title=[[Main Page]]
+preload
 !! input
-{{int:Bug32057}}
+* <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
 !! result
-<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Headline text">edit</a>]</span> <span class="mw-headline" id="Headline_text"> Headline text </span></h2>
-
+* <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
 !! end
 
 !! test
-Strip marker in urlencode
+Play a bit with r67090 and bug 3158 
+!! options
+disabled
 !! input
-{{urlencode:x<nowiki/>y}}
-{{urlencode:x<nowiki/>y|wiki}}
-{{urlencode:x<nowiki/>y|path}}
+<div style="width:50% !important">&nbsp;</div>
+<div style="width:50%&nbsp;!important">&nbsp;</div>
+<div style="width:50%&#160;!important">&nbsp;</div>
+<div style="border : solid;">&nbsp;</div>
 !! result
-<p>xy
-xy
-xy
-</p>
+<div style="width:50% !important">&nbsp;</div>
+<div style="width:50% !important">&nbsp;</div>
+<div style="width:50% !important">&nbsp;</div>
+<div style="border&#160;: solid;">&nbsp;</div>
+
 !! end
 
 !! test
-Strip marker in lc
+HTML5 data attributes
 !! input
-{{lc:x<nowiki/>y}}
+<span data-foo="bar">Baz</span>
+<p data-abc-def_hij="">Quuz</p>
 !! result
-<p>xy
+<p><span data-foo="bar">Baz</span>
 </p>
+<p data-abc-def_hij="">Quuz</p>
+
 !! end
 
 !! test
-Strip marker in uc
+percent-encoding and + signs in internal links (Bug 26410)
 !! input
-{{uc:x<nowiki/>y}}
+[[User:+%]] [[Page+title%]]
+[[%+]] [[%+|%20]] [[%+ ]] [[%+r]]
+[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
+[[%33%45]] [[%33%45+]]
 !! result
-<p>XY
+<p><a href="/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
+<a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
+<a href="/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
+<a href="/index.php?title=3E&amp;action=edit&amp;redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="/index.php?title=3E%2B&amp;action=edit&amp;redlink=1" class="new" title="3E+ (page does not exist)">3E+</a>
 </p>
 !! end
 
 !! test
-Strip marker in formatNum
+Special characters in embedded file links (bug 27679)
 !! input
-{{formatnum:1<nowiki/>2}}
-{{formatnum:1<nowiki/>2|R}}
+[[File:Contains & ampersand.jpg]]
+[[File:Does not exist.jpg|Title with & ampersand]]
 !! result
-<p>12
-12
+<p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
+<a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
 </p>
 !! end
 
+
 !! test
-Strip marker in grammar
-!! options
-language=fi
+Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
 !! input
-{{grammar:elative|foo<nowiki/>bar}}
+Text&apos;s been normalized?
 !! result
-<p>foobarista
+<p>Text&#39;s been normalized?
 </p>
 !! end
 
 !! test
-Strip marker in padleft
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
 !! input
-{{padleft:|2|x<nowiki/>y}}
+http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
 !! result
-<p>xy
+<p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
 
 !! test
-Strip marker in padright
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
 !! input
-{{padright:|2|x<nowiki/>y}}
+[http://www.example.org/ ideograms]
 !! result
-<p>xy
+<p><a rel="nofollow" class="external text" href="http://www.example.org/">ideograms</a>
 </p>
 !! end
 
 !! test
-Strip marker in anchorencode
+Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links
 !! input
-{{anchorencode:x<nowiki/>y}}
+http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
 !! result
-<p>xy
+<p><img src="http://www.example.org/pic.png" alt="pic.png" /> &lt;-- U+3000 (vim: ^Vu3000)
 </p>
 !! end
 
-!! test
-nowiki inside link inside heading (bug 18295)
-!! input
-==[[foo|x<nowiki>y</nowiki>z]]==
-!! result
-<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: xyz">edit</a>]</span> <span class="mw-headline" id="xyz"><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">xyz</a></span></h2>
+!! article
+Mediawiki:loop1
+!! text
+{{Identical|A}}
+!! endarticle
 
-!! end
+!! article
+Mediawiki:loop2
+!! text
+{{Identical|B}}
+!! endarticle
+
+!! article
+Template:Identical
+!! text
+{{int:loop1}}
+{{int:loop2}}
+!! endarticle
 
 !! test
-new support for bdi element (bug 31817)
+Bug 31098 Template which includes system messages which includes the template
 !! input
-<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
+{{Identical}}
 !! result
-<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
-
-!!end
+<p><span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
+<span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
+</p>
+!! end
 
 !! test
-Ignore pipe between table row attributes
+Deprecated presentational attributes are converted to css
 !! input
 {|
-| quux
-|- id=foo | style='color: red'
-| bar
+| valign=top align=left width=100 height=25% | Asdf
 |}
+<ul type="disc"></ul>
 !! result
 <table>
 <tr>
-<td> quux
-</td></tr>
-<tr id="foo" style="color: red">
-<td> bar
+<td style="text-align: left; height: 25%; vertical-align: top; width: 100px;"> Asdf
 </td></tr></table>
+<ul style="list-style-type: disc;"></ul>
 
 !! end
 
-!!test
-Gallery override link with WikiLink (bug 34852)
+!! test
+Bug31490 Turkish: ucfirst 'blah'
+!! options
+language=tr
 !! input
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
-</gallery>
+{{ucfirst:blah}}
 !! 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>Blah
 </p>
-                       </div>
-               </div></li>
-</ul>
-
 !! end
 
-!!test
-Gallery override link with absolute external link (bug 34852)
+!! test
+Bug31490 Turkish: ucfirst 'ix'
+!! options
+language=tr
 !! input
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
-</gallery>
+{{ucfirst:ix}}
 !! 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>İx
 </p>
-                       </div>
-               </div></li>
-</ul>
-
 !! end
 
-!!test
-Gallery override link with malicious javascript (bug 34852)
+!! test
+Bug31490 Turkish: lcfirst 'BLAH'
+!! options
+language=tr
 !! input
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
-</gallery>
+{{lcfirst:BLAH}}
 !! 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>bLAH
 </p>
-                       </div>
-               </div></li>
-</ul>
-
 !! end
 
-!!test
-Language parser function
+!! test
+Bug31490 Turkish: ucfırst (with a dotless i)
+!! options
+language=tr
 !! input
-{{#language:ar}}
+{{ucfırst:blah}}
 !! result
-<p>العربية
+<p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
 </p>
 !! end
 
-!!test
-Padleft and padright as substr
+!! test
+Bug31490 ucfırst (with a dotless i) with English language
+!! options
+language=en
 !! input
-{{padleft:|3|abcde}}
-{{padright:|3|abcde}}
+{{ucfırst:blah}}
 !! result
-<p>abc
-abc
+<p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
 </p>
 !! end
 
 !! test
-Definition Lists: No nesting: Multiple dd's
+Bug 26375: TOC with italics
+!! options
+title=[[Main Page]]
 !! input
-;x
-:a
-:b
+__TOC__
+== ''Lost'' episodes ==
 !! result
-<dl><dt>x
-</dt><dd>a
-</dd><dd>b
-</dd></dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Lost episodes">edit</a>]</span> <span class="mw-headline" id="Lost_episodes"> <i>Lost</i> episodes </span></h2>
 
 !! end
 
 !! test
-Definition Lists: Indentation: Regular
+Bug 26375: TOC with bold 
+!! options
+title=[[Main Page]]
 !! input
-:i1
-::i2
-:::i3
+__TOC__
+== '''should be bold''' then normal text ==
 !! result
-<dl><dd>i1
-<dl><dd>i2
-<dl><dd>i3
-</dd></dl>
-</dd></dl>
-</dd></dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: should be bold then normal text">edit</a>]</span> <span class="mw-headline" id="should_be_bold_then_normal_text"> <b>should be bold</b> then normal text </span></h2>
 
 !! end
 
 !! test
-Definition Lists: Indentation: Missing 1st level
+Bug 33845: Headings become cursive in TOC when they contain an image
+!! options
+title=[[Main Page]]
 !! input
-::i2
-:::i3
+__TOC__
+== Image [[Image:foobar.jpg]] ==
 !! result
-<dl><dd><dl><dd>i2
-<dl><dd>i3
-</dd></dl>
-</dd></dl>
-</dd></dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Image">edit</a>]</span> <span class="mw-headline" id="Image"> Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </span></h2>
 
 !! end
 
 !! test
-Definition Lists: Indentation: Multi-level indent
+Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
+!! options
+title=[[Main Page]]
 !! input
-:::i3
+__TOC__
+== <blockquote>Quote</blockquote> ==
 !! result
-<dl><dd><dl><dd><dl><dd>i3
-</dd></dl>
-</dd></dl>
-</dd></dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Quote">edit</a>]</span> <span class="mw-headline" id="Quote"> <blockquote>Quote</blockquote> </span></h2>
 
 !! end
 
-## The PHP parser treats : items (dd) without a corresponding ; item (dt)
-## as an empty dt item.  It also ignores all but the last ";" when followed
-## by ":" later on.  So, ";" are not ignored in ";;;t3" but are ignored  in
-## ";;;t3 :d1".  So, PHP parser behavior is a little inconsistent wrt multiple
-## ";"s.
-##
-## Ex: ";;t2 ::d2" is transformed into:
-##
-## <dl>
-##   <dt>t2 </dt>
-##   <dd>
-##     <dl>
-##       <dt></dt>
-##       <dd>d2</dd>
-##     </dl>
-##   </dd>
-## </dl>
-##
-## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
-## So, the same wikitext above (;;t2 ::d2) is transformed into:
-##
-## <dl>
-##   <dt>
-##     <dl>
-##       <dt>t2 </dt>
-##       <dd>:d2</dd>
-##     </dl>
-##    </dt>
-## </dl>
-##
-## All Parsoid only definition list tests have this difference.
-
 !! test
-Definition Lists: Nesting: Multi-level (Parsoid only)
+Unclosed tags in TOC
 !! options
-disabled
+title=[[Main Page]]
 !! input
-;t1 :d1
-;;t2 ::d2
-;;;t3 :::d3
+__TOC__
+== Proof: 2 < 3 ==
+<small>Hanc marginis exiguitas non caperet.</small>
+QED
 !! result
-<dl>
-  <dt>t1 </dt>
-  <dd>d1</dd>
-  <dt>
-    <dl>
-      <dt>t2 </dt>
-      <dd>:d2</dd>
-      <dt>
-        <dl>
-          <dt>t3 </dt>
-          <dd>::d3</dd>
-        </dl>
-      </dt>
-    </dl>
-  </dt>
-</dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 &lt; 3</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Proof: 2 &lt; 3">edit</a>]</span> <span class="mw-headline" id="Proof:_2_.3C_3"> Proof: 2 &lt; 3 </span></h2>
+<p><small>Hanc marginis exiguitas non caperet.</small>
+QED
+</p>
+!! end
 
+!! test
+Multiple tags in TOC
+!! input
+__TOC__
+== <i>Foo</i> <b>Bar</b> ==
 
-!! end
+== <i>Foo</i> <blockquote>Bar</blockquote> ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar"> <i>Foo</i> <b>Bar</b> </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> <i>Foo</i> <blockquote>Bar</blockquote> </span></h2>
 
+!! end
 
 !! test
-Definition Lists: Nesting: Test 2 (Parsoid only)
-!! options
-disabled
+Tags with parameters in TOC
 !! input
-;t1
-::d2
+__TOC__
+== <sup class="in-h2">Hello</sup> ==
+
+== <sup class="a > b">Evilbye</sup> ==
 !! result
-<dl>
-  <dt>t1</dt>
-  <dd>
-    <dl>
-      <dd>d2</dd>
-    </dl>
-  </dd>
-</dl>
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Hello"><span class="tocnumber">1</span> <span class="toctext"><sup>Hello</sup></span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b"&gt;Evilbye</sup></span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Hello">edit</a>]</span> <span class="mw-headline" id="Hello"> <sup class="in-h2">Hello</sup> </span></h2>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: b&quot;>Evilbye">edit</a>]</span> <span class="mw-headline" id="b.22.3EEvilbye"> <sup> b"&gt;Evilbye</sup> </span></h2>
 
 !! end
 
+!! article
+MediaWiki:Bug32057
+!! text
+== {{int:headline_sample}} ==
+!! endarticle
 
 !! test
-Definition Lists: Nesting: Test 3 (Parsoid only)
+Bug 32057: Title needed when expanding <h> nodes.
 !! options
-disabled
+title=[[Main Page]]
 !! input
-:;t1
-::::d2
+{{int:Bug32057}}
 !! result
-<dl>
-  <dd>
-    <dl>
-      <dt>t1</dt>
-      <dd>
-        <dl>
-          <dd>
-            <dl>
-              <dd>d2</dd>
-            </dl>
-          </dd>
-        </dl>
-      </dd>
-    </dl>
-  </dd>
-</dl>
+<h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Headline text">edit</a>]</span> <span class="mw-headline" id="Headline_text"> Headline text </span></h2>
+
+!! end
 
+!! test
+Strip marker in urlencode
+!! input
+{{urlencode:x<nowiki/>y}}
+{{urlencode:x<nowiki/>y|wiki}}
+{{urlencode:x<nowiki/>y|path}}
+!! result
+<p>xy
+xy
+xy
+</p>
 !! end
 
-
 !! test
-Definition Lists: Nesting: Test 4
+Strip marker in lc
 !! input
-::;t3
-:::d3
+{{lc:x<nowiki/>y}}
 !! result
-<dl><dd><dl><dd><dl><dt>t3
-</dt><dd>d3
-</dd></dl>
-</dd></dl>
-</dd></dl>
-
+<p>xy
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 1
+Strip marker in uc
 !! input
-:;* foo
-::* bar
-:; baz
+{{uc:x<nowiki/>y}}
 !! result
-<dl><dd><dl><dt><ul><li> foo
-</li><li> bar
-</li></ul>
-</dt></dl>
-<dl><dt> baz
-</dt></dl>
-</dd></dl>
-
+<p>XY
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 2
+Strip marker in formatNum
 !! input
-*: d1
-*: d2
+{{formatnum:1<nowiki/>2}}
+{{formatnum:1<nowiki/>2|R}}
 !! result
-<ul><li><dl><dd> d1
-</dd><dd> d2
-</dd></dl>
-</li></ul>
-
+<p>12
+12
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 3
+Strip marker in grammar
+!! options
+language=fi
 !! input
-*::: d1
-*::: d2
+{{grammar:elative|foo<nowiki/>bar}}
 !! result
-<ul><li><dl><dd><dl><dd><dl><dd> d1
-</dd><dd> d2
-</dd></dl>
-</dd></dl>
-</dd></dl>
-</li></ul>
-
+<p>foobarista
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 4
+Strip marker in padleft
 !! input
-*;d1 :d2
-*;d3 :d4
+{{padleft:|2|x<nowiki/>y}}
 !! result
-<ul><li><dl><dt>d1&#160;</dt><dd>d2
-</dd><dt>d3&#160;</dt><dd>d4
-</dd></dl>
-</li></ul>
-
+<p>xy
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 5
+Strip marker in padright
 !! input
-*:d1
-*:: d2
+{{padright:|2|x<nowiki/>y}}
 !! result
-<ul><li><dl><dd>d1
-<dl><dd> d2
-</dd></dl>
-</dd></dl>
-</li></ul>
-
+<p>xy
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 6
+Strip marker in anchorencode
 !! input
-#*:d1
-#*::: d3
+{{anchorencode:x<nowiki/>y}}
 !! result
-<ol><li><ul><li><dl><dd>d1
-<dl><dd><dl><dd> d3
-</dd></dl>
-</dd></dl>
-</dd></dl>
-</li></ul>
-</li></ol>
-
+<p>xy
+</p>
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 7
+nowiki inside link inside heading (bug 18295)
 !! input
-:* d1
-:* d2
+==[[foo|x<nowiki>y</nowiki>z]]==
 !! result
-<dl><dd><ul><li> d1
-</li><li> d2
-</li></ul>
-</dd></dl>
+<h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: xyz">edit</a>]</span> <span class="mw-headline" id="xyz"><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">xyz</a></span></h2>
 
 !! end
 
-
 !! test
-Definition Lists: Mixed Lists: Test 8
+new support for bdi element (bug 31817)
 !! input
-:* d1
-::* d2
+<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 !! result
-<dl><dd><ul><li> d1
-</li></ul>
-<dl><dd><ul><li> d2
-</li></ul>
-</dd></dl>
-</dd></dl>
-
-!! end
+<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 
+!!end
 
 !! test
-Definition Lists: Mixed Lists: Test 9
+Ignore pipe between table row attributes
 !! input
-*;foo :bar
+{|
+| quux
+|- id=foo | style='color: red'
+| bar
+|}
 !! result
-<ul><li><dl><dt>foo&#160;</dt><dd>bar
-</dd></dl>
-</li></ul>
+<table>
+<tr>
+<td> quux
+</td></tr>
+<tr id="foo" style="color: red">
+<td> bar
+</td></tr></table>
 
 !! end
 
-
-!! test
-Definition Lists: Mixed Lists: Test 10
+!!test
+Gallery override link with WikiLink (bug 34852)
 !! input
-*#;foo :bar
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
+</gallery>
 !! result
-<ul><li><ol><li><dl><dt>foo&#160;</dt><dd>bar
-</dd></dl>
-</li></ol>
-</li></ul>
+<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
-Definition Lists: Mixed Lists: Test 11
+!!test
+Gallery override link with absolute external link (bug 34852)
 !! input
-*#*#;*;;foo :bar
-*#*#;boo :baz
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
+</gallery>
 !! result
-<ul><li><ol><li><ul><li><ol><li><dl><dt>foo&#160;</dt><dd><ul><li><dl><dt><dl><dt>bar
-</dt></dl>
-</dd></dl>
-</li></ul>
-</dd></dl>
-<dl><dt>boo&#160;</dt><dd>baz
-</dd></dl>
-</li></ol>
-</li></ul>
-</li></ol>
-</li></ul>
+<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
-Definition Lists: Weird Ones: Test 1
+!!test
+Language parser function
 !! input
-*#;*::;; foo : bar (who uses this?)
+{{#language:ar}}
 !! result
-<ul><li><ol><li><dl><dt> foo&#160;</dt><dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)
-</dt></dl>
-</dd></dl>
-</dd></dl>
-</dd></dl>
-</li></ul>
-</dd></dl>
-</li></ol>
-</li></ul>
+<p>العربية
+</p>
+!! end
 
+!!test
+Padleft and padright as substr
+!! input
+{{padleft:|3|abcde}}
+{{padright:|3|abcde}}
+!! result
+<p>abc
+abc
+</p>
 !! end
 
+
 TODO:
 more images
 more tables