Merge "Clean up Language::markNoConversion()."
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index b1c8858..0384434 100644 (file)
@@ -102,6 +102,12 @@ Template:table_attribs
 |</noinclude>style="color: red"| Foo
 !! endarticle
 
+!! article
+A?b
+!! text
+Weirdo titles!
+!! endarticle
+
 ###
 ### Basic tests
 ###
@@ -2572,6 +2578,31 @@ A table with nothing but a caption
 
 !! end
 
+!! test
+Table td-cell syntax variations
+!! input
+{|
+| foo bar foo | baz
+| foo bar foo || baz
+| style='color:red;' | baz
+| style='color:red;' || baz
+|}
+!! result
+<table>
+<tr>
+<td> baz
+</td>
+<td> foo bar foo </td>
+<td> baz
+</td>
+<td style="color:red;"> baz
+</td>
+<td> style='color:red;' </td>
+<td> baz
+</td></tr></table>
+
+!! end
+
 !! test
 Simple table
 !! input
@@ -3149,6 +3180,18 @@ Plain link to protocol-relative URL with link text
 </p>
 !! end
 
+!! test
+Plain link to page with question mark in title
+!! input
+[[A?b]]
+
+[[A?b|Baz]]
+!! result
+<p><a href="/wiki/A%3Fb" title="A?b">A?b</a>
+</p><p><a href="/wiki/A%3Fb" title="A?b">Baz</a>
+</p>
+!! end
+
 
 # I'm fairly sure the expected result here is wrong.
 # We want these to be URL links, not pseudo-pages with URLs for titles....
@@ -3539,6 +3582,15 @@ Horizontal ruler -- <4 dashes render as plain text
 </p>
 !! end
 
+!! test
+Horizontal ruler -- Supports content following dashes on same line
+!! input
+---- Foo
+!! result
+<hr /> Foo
+
+!! end
+
 ###
 ### Block-level elements
 ###
@@ -4734,6 +4786,13 @@ Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
 </p>
 !! end
 
+!! test
+Un-closed <noinclude>
+!! input
+<noinclude>
+!! result
+!! end
+
 !! test
 <onlyinclude> on a page
 !! input
@@ -4743,6 +4802,13 @@ Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
 </p>
 !! end
 
+!! test
+Un-closed <onlyinclude>
+!! input
+<onlyinclude>
+!! result
+!! end
+
 !! article
 Template:Includeonly section
 !! text
@@ -4801,6 +4867,13 @@ section=1
 ==Section 1==
 !! end
 
+!! test
+Un-closed <includeonly>
+!! input
+<includeonly>
+!! result
+!! end
+
 ###
 ### <includeonly> and <noinclude> in attributes
 ###
@@ -6045,6 +6118,19 @@ Image with multiple captions -- only last one is accepted
 
 !! end
 
+!! test
+Image with width attribute at different positions
+!! input
+[[Image:foobar.jpg|200px|right|Caption]]
+[[Image:foobar.jpg|right|200px|Caption]]
+[[Image:foobar.jpg|right|Caption|200px]]
+!! result
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+
+!! end
+
 !! test
 Image with link parameter, wiki target
 !! input
@@ -7188,6 +7274,23 @@ DIV IN UPPERCASE
 
 !!end
 
+!! test
+Non-ASCII pseudo-tags are rendered as text
+!! input
+<khyô>
+!! result
+<p>&lt;khyô&gt;
+</p>
+!! end
+
+!! test
+Pseudo-tag with URL 'name' renders as url link
+!! input
+<http://example.com/>
+!! result
+<p>&lt;<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&gt;
+</p>
+!! end
 
 !! test
 text with amp in the middle of nowhere
@@ -7974,6 +8077,30 @@ disabled
 Something need to be done. foo-2 ? 
 !! end
 
+!! test
+Sanitizer: Validating that <meta> and <link> work, but only for Microdata
+!! input
+<div itemscope>
+       <meta itemprop="hello" content="world">
+       <meta http-equiv="refresh" content="5">
+       <meta itemprop="hello" http-equiv="refresh" content="5">
+       <link itemprop="hello" href="{{SERVER}}">
+       <link rel="stylesheet" href="{{SERVER}}">
+       <link rel="stylesheet" itemprop="hello" href="{{SERVER}}">
+</div>
+!! result
+<div itemscope="itemscope">
+<p>    <meta itemprop="hello" content="world" />
+       &lt;meta http-equiv="refresh" content="5"&gt;
+       <meta itemprop="hello" content="5" />
+</p>
+       <link itemprop="hello" href="http&#58;//Britney-Spears" />
+       &lt;link rel="stylesheet" href="<a rel="nofollow" class="external free" href="http://Britney-Spears">http://Britney-Spears</a>"&gt;
+       <link itemprop="hello" href="http&#58;//Britney-Spears" />
+</div>
+
+!! end
+
 !! test
 Language converter: output gets cut off unexpectedly (bug 5757)
 !! options
@@ -11487,22 +11614,6 @@ Bug 31098 Template which includes system messages which includes the template
 </p>
 !! end
 
-!! test
-Deprecated presentational attributes are converted to css
-!! input
-{|
-| valign=top align=left width=100 height=25% | Asdf
-|}
-<ul type="disc"></ul>
-!! 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>
-
-!! end
-
 !! test
 Bug31490 Turkish: ucfirst 'blah'
 !! options
@@ -12707,6 +12818,48 @@ Escaping nowikis
 </p>
 !! end
 
+!! test
+Tag-like HTML structures are passed through as text
+!! input
+<x y>
+
+<x.y>
+
+<x-y>
+
+1>2
+
+x<y
+
+a>b
+
+1<d e>f
+!! result
+<p>&lt;x y&gt;
+</p><p>&lt;x.y&gt;
+</p><p>&lt;x-y&gt;
+</p><p>1&gt;2
+</p><p>x&lt;y
+</p><p>a&gt;b
+</p><p>1&lt;d e&gt;f
+</p>
+!! end
+
+
+# This fails in the PHP parser (see bug 40670,
+# https://bugzilla.wikimedia.org/show_bug.cgi?id=40670), so disabled for it.
+!! test
+Tag names followed by punctuation should not be recognized as tags
+!! options
+disabled
+!! input
+<s.ome> text
+!! result
+<p>&lt;s.ome&gt text
+</p>
+!! end
+
+
 TODO:
 more images
 more tables