Merge "Math isn't in core, so no point having a TODO in core to do math tests. Just...
authorDemon <chadh@wikimedia.org>
Thu, 28 Jun 2012 13:45:39 +0000 (13:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 28 Jun 2012 13:45:39 +0000 (13:45 +0000)
1  2 
tests/parser/parserTests.txt

@@@ -134,285 -134,6 +134,285 @@@ Italics and bol
  
  !! end
  
 +###
 +### 2-quote opening sequence tests
 +###
 +!! test
 +Italics and bold: 2-quote opening sequence: (2,2)
 +!! input
 +''foo''
 +!! result
 +<p><i>foo</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 2-quote opening sequence: (2,3)
 +!! input
 +''foo'''
 +!! result
 +<p><i>foo'</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 2-quote opening sequence: (2,4)
 +!! input
 +''foo''''
 +!! result
 +<p><i>foo''</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 2-quote opening sequence: (2,5)
 +!! input
 +''foo'''''
 +!! result
 +<p><i>foo</i>
 +</p>
 +!!end
 +
 +
 +###
 +### 3-quote opening sequence tests
 +###
 +
 +!! test
 +Italics and bold: 3-quote opening sequence: (3,2)
 +!! input
 +'''foo''
 +!! result
 +<p>'<i>foo</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 3-quote opening sequence: (3,3)
 +!! input
 +'''foo'''
 +!! result
 +<p><b>foo</b>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 3-quote opening sequence: (3,4)
 +!! input
 +'''foo''''
 +!! result
 +<p><b>foo'</b>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 3-quote opening sequence: (3,5)
 +!! input
 +'''foo'''''
 +!! result
 +<p><b>foo</b>
 +</p>
 +!!end
 +
 +
 +###
 +### 4-quote opening sequence tests
 +###
 +
 +!! test
 +Italics and bold: 4-quote opening sequence: (4,2)
 +!! input
 +''''foo''
 +!! result
 +<p>''<i>foo</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 4-quote opening sequence: (4,3)
 +!! input
 +''''foo'''
 +!! result
 +<p>'<b>foo</b>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 4-quote opening sequence: (4,4)
 +!! input
 +''''foo''''
 +!! result
 +<p>'<b>foo'</b>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 4-quote opening sequence: (4,5)
 +!! input
 +''''foo'''''
 +!! result
 +<p>'<b>foo</b>
 +</p>
 +!!end
 +
 +
 +###
 +### 5-quote opening sequence tests
 +###
 +
 +!! test
 +Italics and bold: 5-quote opening sequence: (5,2)
 +!! input
 +'''''foo''
 +!! result
 +<p><b><i>foo</i></b>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 5-quote opening sequence: (5,3)
 +!! input
 +'''''foo'''
 +!! result
 +<p><i><b>foo</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 5-quote opening sequence: (5,4)
 +!! input
 +'''''foo''''
 +!! result
 +<p><i><b>foo'</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: 5-quote opening sequence: (5,5)
 +!! input
 +'''''foo'''''
 +!! result
 +<p><i><b>foo</b></i>
 +</p>
 +!!end
 +
 +###
 +### multiple quote sequences in a line
 +###
 +!! test
 +Italics and bold: multiple quote sequences: (2,4,2)
 +!! input
 +''foo''''bar''
 +!! result
 +<p><i>foo'<b>bar</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: multiple quote sequences: (2,4,3)
 +!! input
 +''foo''''bar'''
 +!! result
 +<p><i>foo'<b>bar</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: multiple quote sequences: (2,4,4)
 +!! input
 +''foo''''bar''''
 +!! result
 +<p><i>foo'<b>bar'</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: multiple quote sequences: (3,4,2)
 +!! input
 +'''foo''''bar''
 +!! result
 +<p><b>foo'</b>bar
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: multiple quote sequences: (3,4,3)
 +!! input
 +'''foo''''bar'''
 +!! result
 +<p><b>foo'</b>bar
 +</p>
 +!!end
 +
 +###
 +### other quote tests
 +###
 +!! test
 +Italics and bold: other quote tests: (2,3,5)
 +!! input
 +''this is about '''foo's family'''''
 +!! result
 +<p><i>this is about <b>foo's family</b></i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: other quote tests: (2,(3,3),2)
 +!! input
 +''this is about '''foo's''' family''
 +!! result
 +<p><i>this is about <b>foo's</b> family</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: other quote tests: (3,2,3,2)
 +!! input
 +'''this is about ''foo'''s family''
 +!! result
 +<p><b>this is about <i>foo</i></b><i>s family</i>
 +</p>
 +!!end
 +
 +
 +!! test
 +Italics and bold: other quote tests: (3,2,3,3)
 +!! input
 +'''this is about ''foo'''s family'''
 +!! result
 +<p>'<i>this is about </i>foo<b>s family</b>
 +</p>
 +!!end
 +
 +
 +
 +!! test
 +Italics and bold: other quote tests: (3,(2,2),3)
 +!! input
 +'''this is about ''foo's'' family'''
 +!! result
 +<p><b>this is about <i>foo's</i> family</b>
 +</p>
 +!!end
 +
  ###
  ### <nowiki> test cases
  ###
@@@ -931,809 -652,438 +931,809 @@@ Paragraph tex
  </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
 +Definition Lists: Mixed Lists: Test 1
  !! input
 -//example.com/Foo
 +:;* foo
 +::* bar
 +:; baz
  !! result
 -<p>//example.com/Foo
 -</p>
 -!!end
 +<dl><dd><dl><dt><ul><li> foo
 +</li><li> bar
 +</li></ul>
 +</dt></dl>
 +<dl><dt> baz
 +</dt></dl>
 +</dd></dl>
 +
 +!! end
 +
  
  !! test
 -External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
 +Definition Lists: Mixed Lists: Test 2
  !! input
 -foo//example.com/Foo
 +*: d1
 +*: d2
  !! result
 -<p>foo//example.com/Foo
 -</p>
 +<ul><li><dl><dd> d1
 +</dd><dd> d2
 +</dd></dl>
 +</li></ul>
 +
  !! end
  
 +
  !! test
 -External image
 +Definition Lists: Mixed Lists: Test 3
  !! 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><dl><dd><dl><dd> d1
 +</dd><dd> d2
 +</dd></dl>
 +</dd></dl>
 +</dd></dl>
 +</li></ul>
 +
  !! end
  
 +
  !! test
 -External image from https
 +Definition Lists: Mixed Lists: Test 4
  !! input
 -External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
 +*;d1 :d2
 +*;d3 :d4
  !! result
 -<p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
 -</p>
 +<ul><li><dl><dt>d1&#160;</dt><dd>d2
 +</dd><dt>d3&#160;</dt><dd>d4
 +</dd></dl>
 +</li></ul>
 +
  !! end
  
 +
  !! test
 -Link to non-http image, no img tag
 +Definition Lists: Mixed Lists: Test 5
  !! input
 -Link to non-http image, no img tag: ftp://example.com/test.jpg
 +*:d1
 +*:: d2
  !! 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><dd>d1
 +<dl><dd> d2
 +</dd></dl>
 +</dd></dl>
 +</li></ul>
 +
  !! end
  
 +
  !! test
 -External links: terminating separator
 +Definition Lists: Mixed Lists: Test 6
  !! input
 -Terminating separator: http://example.com/thing,
 +#*:d1
 +#*::: d3
  !! result
 -<p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</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: intervening separator
 +Definition Lists: Mixed Lists: Test 7
  !! input
 -Intervening separator: http://example.com/1,2,3
 +:* d1
 +:* d2
  !! 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>
 +<dl><dd><ul><li> d1
 +</li><li> d2
 +</li></ul>
 +</dd></dl>
 +
  !! end
  
 +
  !! test
 -External links: old bug with URL in query
 +Definition Lists: Mixed Lists: Test 8
  !! 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></ul>
 +<dl><dd><ul><li> d2
 +</li></ul>
 +</dd></dl>
 +</dd></dl>
 +
  !! end
  
 +
  !! test
 -External links: old URL-in-URL bug, mixed protocols
 +Definition Lists: Mixed Lists: Test 9
  !! input
 -And again with mixed protocols: [ftp://example.com?url=http://example.com link]
 +*;foo :bar
  !! 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
 +<ul><li><dl><dt>foo&#160;</dt><dd>bar
 +</dd></dl>
 +</li></ul>
 +
 +!! end
 +
  
  !! test
 -External links: URL in text
 +Definition Lists: Mixed Lists: Test 10
  !! input
 -URL in text: [http://example.com http://example.com]
 +*#;foo :bar
  !! result
 -<p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
 -</p>
 +<ul><li><ol><li><dl><dt>foo&#160;</dt><dd>bar
 +</dd></dl>
 +</li></ol>
 +</li></ul>
 +
  !! end
  
 +
  !! test
 -External links: Clickable images
 +Definition Lists: Mixed Lists: Test 11
  !! input
 -ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
 +*#*#;*;;foo :bar
 +*#*#;boo :baz
  !! 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><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: raw ampersand
 +Definition Lists: Weird Ones: Test 1
  !! input
 -Old &amp; use: http://x&y
 +*#;*::;; foo : bar (who uses this?)
  !! 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><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: encoded ampersand
 +External links: non-bracketed
  !! input
 -Old &amp; use: http://x&amp;y
 +Non-bracketed: http://example.com
  !! result
 -<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
 +<p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
  </p>
  !! end
  
  !! test
 -External links: encoded equals (bug 6102)
 +External links: numbered
  !! input
 -http://example.com/?foo&#61;bar
 +Numbered: [http://example.com]
 +Numbered: [http://example.net]
 +Numbered: [http://example.com]
  !! result
 -<p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</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: [raw ampersand]
 +External links: specified text
  !! input
 -Old &amp; use: [http://x&y]
 +Specified text: [http://example.com link]
  !! result
 -<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
 +<p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
  </p>
 -!! end
 +!!end
  
  !! test
 -External links: [encoded ampersand]
 +External links: trail
  !! input
 -Old &amp; use: [http://x&amp;y]
 +Linktrails should not work for external links: [http://example.com link]s
  !! result
 -<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[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: [encoded equals] (bug 6102)
 +External links: dollar sign in URL
  !! input
 -[http://example.com/?foo&#61;bar]
 +http://example.com/1$2345
  !! result
 -<p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</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: [IDN ignored character reference in hostname; strip it right off]
 +External links: dollar sign in URL (named)
  !! input
 -[http://e&zwnj;xample.com/]
 +[http://example.com/1$2345]
  !! result
 -<p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
 +<p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
  </p>
 -!! end
 +!!end
  
  !! test
 -External links: IDN ignored character reference in hostname; strip it right off
 +External links: open square bracket forbidden in URL (bug 4377)
  !! 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">http://example.com/1</a>[2345
  </p>
  !! end
  
  !! test
 -External links: www.jpeg.org (bug 554)
 +External links: open square bracket forbidden in URL (named) (bug 4377)
  !! 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 text" href="http://example.com/1">[2345</a>
  </p>
 -!! end
 +!!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]
 +External links: nowiki in URL link text (bug 6230)
 +!!input
 +[http://example.com/ <nowiki>''example site''</nowiki>]
  !! 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 text" href="http://example.com/">''example site''</a>
  </p>
  !! end
  
  !! test
 -BUG 361: URL inside bracketed URL
 +External links: newline forbidden in text (bug 6230 regression check)
  !! input
 -[http://www.example.com/foo http://www.example.com/bar]
 +[http://example.com/ first
 +second]
  !! 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 free" href="http://example.com/">http://example.com/</a> first
 +second]
  </p>
 -!! end
 +!!end
  
  !! test
 -BUG 361: URL within URL, not bracketed
 +External links: protocol-relative URL in brackets
  !! input
 -http://www.example.com/foo?=http://www.example.com/bar
 +[//example.com/ Test]
  !! 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="//example.com/">Test</a>
  </p>
  !! end
  
  !! test
 -BUG 289: ">"-token in URL-tail
 +External links: protocol-relative URL in brackets without text
  !! input
 -http://www.example.com/<hello>
 +[//example.com]
  !! 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 autonumber" href="//example.com">[1]</a>
  </p>
 -!!end
 +!! end
  
  !! test
 -BUG 289: literal ">"-token in URL-tail
 +External links: protocol-relative URL in free text is left alone
  !! input
 -http://www.example.com/<b>html</b>
 +//example.com/Foo
  !! result
 -<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
 +<p>//example.com/Foo
  </p>
  !!end
  
  !! test
 -BUG 289: ">"-token in bracketed URL
 +External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
  !! input
 -[http://www.example.com/<hello> stuff]
 +foo//example.com/Foo
  !! result
 -<p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
 +<p>foo//example.com/Foo
  </p>
 -!!end
 +!! end
  
  !! test
 -BUG 289: literal ">"-token in bracketed URL
 +External image
  !! input
 -[http://www.example.com/<b>html</b> stuff]
 +External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
  !! result
 -<p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
 +<p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
  </p>
 -!!end
 +!! end
  
  !! test
 -BUG 289: literal double quote at end of URL
 +External image from https
  !! input
 -http://www.example.com/"hello"
 +External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
  !! result
 -<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
 +<p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
  </p>
 -!!end
 +!! end
  
  !! test
 -BUG 289: literal double quote in bracketed URL
 +Link to non-http image, no img tag
  !! input
 -[http://www.example.com/"hello" stuff]
 +Link to non-http image, no img tag: ftp://example.com/test.jpg
  !! result
 -<p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
 +<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
 +!! end
  
  !! test
 -External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
 +External links: terminating separator
  !! input
 -[http://www.example.com  test]
 +Terminating separator: http://example.com/thing,
  !! result
 -<p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
 +<p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
  </p>
  !! end
  
  !! test
 -External links: wiki links within external link (Bug 3695)
 +External links: intervening separator
  !! input
 -[http://example.com [[wikilink]] embedded in ext link]
 +Intervening separator: http://example.com/1,2,3
  !! result
 -<p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
 +<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
 -BUG 787: Links with one slash after the url protocol are invalid
 +External links: old bug with URL in query
  !! input
 -http:/example.com
 -
 -[http:/example.com title]
 +Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
  !! result
 -<p>http:/example.com
 -</p><p>[http:/example.com title]
 +<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
 -Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
 +External links: old URL-in-URL bug, mixed protocols
  !! input
 -''[http://example.com text'']
 -[http://example.com '''text]'''
 -''Something [http://example.com in italic'']
 -''Something [http://example.com mixed''''', even bold]'''
 -'''''Now [http://example.com both''''']
 +And again with mixed protocols: [ftp://example.com?url=http://example.com link]
  !! result
 -<p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
 -<a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
 -<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
 -<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>mixed</i><b>, even bold</b></a>
 -<i><b>Now </b></i><a rel="nofollow" class="external text" href="http://example.com"><i><b>both</b></i></a>
 +<p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
  </p>
 -!! end
 -
 +!!end
  
  !! test
 -Bug 4781: %26 in URL
 +External links: URL in text
  !! input
 -http://www.example.com/?title=AT%26T
 +URL in text: [http://example.com http://example.com]
  !! result
 -<p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
 +<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
 +
 +!! test
 +BUG 289: literal double quote in bracketed URL
 +!! input
 +[http://www.example.com/"hello" stuff]
 +!! result
 +<p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
 +</p>
 +!!end
 +
 +!! test
 +External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
 +!! input
 +[http://www.example.com  test]
 +!! result
 +<p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
 +</p>
 +!! end
 +
 +!! test
 +External links: wiki links within external link (Bug 3695)
 +!! input
 +[http://example.com [[wikilink]] embedded in ext link]
 +!! result
 +<p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
 +</p>
 +!! end
 +
 +!! test
 +BUG 787: Links with one slash after the url protocol are invalid
 +!! input
 +http:/example.com
 +
 +[http:/example.com title]
 +!! result
 +<p>http:/example.com
 +</p><p>[http:/example.com title]
 +</p>
 +!! end
 +
 +!! test
 +Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
 +!! input
 +''[http://example.com text'']
 +[http://example.com '''text]'''
 +''Something [http://example.com in italic'']
 +''Something [http://example.com mixed''''', even bold]'''
 +'''''Now [http://example.com both''''']
 +!! result
 +<p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
 +<a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
 +<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
 +<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>mixed</i><b>, even bold</b></a>
 +<i><b>Now </b></i><a rel="nofollow" class="external text" href="http://example.com"><i><b>both</b></i></a>
 +</p>
 +!! end
 +
 +
 +!! test
 +Bug 4781: %26 in URL
 +!! input
 +http://www.example.com/?title=AT%26T
 +!! result
 +<p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
  </p>
  !! end
  
@@@ -9993,202 -9343,569 +9993,201 @@@ title=[[Main Page]
  !! 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
 -Strip marker in lc
 -!! input
 -{{lc:x<nowiki/>y}}
 -!! result
 -<p>xy
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in uc
 -!! input
 -{{uc:x<nowiki/>y}}
 -!! result
 -<p>XY
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in formatNum
 -!! input
 -{{formatnum:1<nowiki/>2}}
 -{{formatnum:1<nowiki/>2|R}}
 -!! result
 -<p>12
 -12
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in grammar
 -!! options
 -language=fi
 -!! input
 -{{grammar:elative|foo<nowiki/>bar}}
 -!! result
 -<p>foobarista
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in padleft
 -!! input
 -{{padleft:|2|x<nowiki/>y}}
 -!! result
 -<p>xy
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in padright
 -!! input
 -{{padright:|2|x<nowiki/>y}}
 -!! result
 -<p>xy
 -</p>
 -!! end
 -
 -!! test
 -Strip marker in anchorencode
 -!! input
 -{{anchorencode:x<nowiki/>y}}
 -!! result
 -<p>xy
 -</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>
 -
 -!! end
 -
 -!! test
 -new support for bdi element (bug 31817)
 -!! input
 -<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 -!! result
 -<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 -
 -!!end
 -
 -!! test
 -Ignore pipe between table row attributes
 -!! input
 -{|
 -| quux
 -|- id=foo | style='color: red'
 -| bar
 -|}
 -!! result
 -<table>
 -<tr>
 -<td> quux
 -</td></tr>
 -<tr id="foo" style="color: red">
 -<td> bar
 -</td></tr></table>
 -
 -!! end
 -
 -!!test
 -Gallery override link with WikiLink (bug 34852)
 -!! input
 -<gallery>
 -File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
 -</gallery>
 -!! result
 -<ul class="gallery">
 -              <li class="gallerybox" style="width: 155px"><div style="width: 155px">
 -                      <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
 -                      <div class="gallerytext">
 -<p>caption
 -</p>
 -                      </div>
 -              </div></li>
 -</ul>
 -
 -!! end
 -
 -!!test
 -Gallery override link with absolute external link (bug 34852)
 -!! input
 -<gallery>
 -File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
 -</gallery>
 -!! result
 -<ul class="gallery">
 -              <li class="gallerybox" style="width: 155px"><div style="width: 155px">
 -                      <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
 -                      <div class="gallerytext">
 -<p>caption
 -</p>
 -                      </div>
 -              </div></li>
 -</ul>
 -
 -!! end
 -
 -!!test
 -Gallery override link with malicious javascript (bug 34852)
 -!! input
 -<gallery>
 -File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
 -</gallery>
 -!! result
 -<ul class="gallery">
 -              <li class="gallerybox" style="width: 155px"><div style="width: 155px">
 -                      <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
 -                      <div class="gallerytext">
 -<p>caption
 -</p>
 -                      </div>
 -              </div></li>
 -</ul>
 -
 -!! end
 -
 -!!test
 -Language parser function
 -!! input
 -{{#language:ar}}
 -!! result
 -<p>العربية
 -</p>
 -!! end
 -
 -!!test
 -Padleft and padright as substr
 -!! input
 -{{padleft:|3|abcde}}
 -{{padright:|3|abcde}}
 -!! result
 -<p>abc
 -abc
 -</p>
 -!! end
 -
 -!! test
 -Definition Lists: No nesting: Multiple dd's
 -!! input
 -;x
 -:a
 -:b
 -!! result
 -<dl><dt>x
 -</dt><dd>a
 -</dd><dd>b
 -</dd></dl>
 -
 -!! end
 -
 -!! test
 -Definition Lists: Indentation: Regular
 -!! input
 -:i1
 -::i2
 -:::i3
 -!! result
 -<dl><dd>i1
 -<dl><dd>i2
 -<dl><dd>i3
 -</dd></dl>
 -</dd></dl>
 -</dd></dl>
 -
 -!! end
 -
 -!! test
 -Definition Lists: Indentation: Missing 1st level
 -!! input
 -::i2
 -:::i3
 -!! result
 -<dl><dd><dl><dd>i2
 -<dl><dd>i3
 -</dd></dl>
 -</dd></dl>
 -</dd></dl>
 -
 -!! end
 -
 -!! test
 -Definition Lists: Indentation: Multi-level indent
 -!! input
 -:::i3
 -!! result
 -<dl><dd><dl><dd><dl><dd>i3
 -</dd></dl>
 -</dd></dl>
 -</dd></dl>
 -
 -!! 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)
 -!! options
 -disabled
 -!! input
 -;t1 :d1
 -;;t2 ::d2
 -;;;t3 :::d3
 -!! 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>
 -
 -
 -!! end
 -
 -
 -!! test
 -Definition Lists: Nesting: Test 2 (Parsoid only)
 -!! options
 -disabled
 -!! input
 -;t1
 -::d2
 -!! result
 -<dl>
 -  <dt>t1</dt>
 -  <dd>
 -    <dl>
 -      <dd>d2</dd>
 -    </dl>
 -  </dd>
 -</dl>
 -
 -!! end
 -
 -
 -!! test
 -Definition Lists: Nesting: Test 3 (Parsoid only)
 -!! options
 -disabled
 -!! input
 -:;t1
 -::::d2
 -!! result
 -<dl>
 -  <dd>
 -    <dl>
 -      <dt>t1</dt>
 -      <dd>
 -        <dl>
 -          <dd>
 -            <dl>
 -              <dd>d2</dd>
 -            </dl>
 -          </dd>
 -        </dl>
 -      </dd>
 -    </dl>
 -  </dd>
 -</dl>
 -
 +{{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
- math
  character entities
  and much more
  Try for 100% code coverage