1 # MediaWiki Parser test cases
2 # see also http://meta.wikimedia.org/wiki/Parser_testing
4 # At present these assume that $wgUseTidy is false and may break
16 This is a simple paragraph.
18 <p>This is a simple paragraph.
37 * plain''italic''plain
38 * plain''italic''plain''italic''plain
39 * plain'''bold'''plain
40 * plain'''bold'''plain'''bold'''plain
41 * plain''italic''plain'''bold'''plain
42 * plain'''bold'''plain''italic''plain
43 * plain''italic'''bold-italic'''italic''plain
44 * plain'''bold''bold-italic''bold'''plain
45 * plain'''''bold-italic'''italic''plain
46 * plain'''''bold-italic''bold'''plain
47 * plain''italic'''bold-italic'''''plain
48 * plain'''bold''bold-italic'''''plain
49 * plain l'''italic''plain
52 </li><li> plain<i>italic</i>plain
53 </li><li> plain<i>italic</i>plain<i>italic</i>plain
54 </li><li> plain<b>bold</b>plain
55 </li><li> plain<b>bold</b>plain<b>bold</b>plain
56 </li><li> plain<i>italic</i>plain<b>bold</b>plain
57 </li><li> plain<b>bold</b>plain<i>italic</i>plain
58 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
59 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
60 </li><li> plain<i><b>bold-italic</b>italic</i>plain
61 </li><li> plain<b><i>bold-italic</i>bold</b>plain
62 </li><li> plain<i>italic<b>bold-italic</b></i>plain
63 </li><li> plain<b>bold<i>bold-italic</i></b>plain
64 </li><li> plain l'<i>italic</i>plain
69 ### <nowiki> test cases
73 <nowiki> unordered list
75 <nowiki>* This is not an unordered list item.</nowiki>
77 <p>* This is not an unordered list item.
84 <nowiki>Lorem ipsum dolor
92 <p>Lorem ipsum dolor sed abit. sed nullum. :and a colon</p>
99 :There is <nowiki>nowiki</nowiki>.
101 #There is not nowiki.
102 #There is <nowiki>nowiki</nowiki>.
104 *There is not nowiki.
105 *There is <nowiki>nowiki</nowiki>.
107 <dl><dd>There is not nowiki.
108 </dd><dd>There is nowiki.
110 <ol><li>There is not nowiki.
111 </li><li>There is nowiki.
113 <ul><li>There is not nowiki.
114 </li><li>There is nowiki.
119 ### comment test cases
124 <!-- comment 1 --> asdf
159 asdf<!-- comment 1 -->jkl
171 Non-bracketed: http://example.com
173 Numbered: [http://example.com]
175 Specified text: [http://example.com link]
177 Trail (not sure if this is meant to work): [http://example.com link]s
179 <p>Non-bracketed: <a href="http://example.com" class='external' title="http://example.com">http://example.com</a>
180 </p><p>Numbered: <a href="http://example.com" class='external' title="http://example.com">[1]</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
181 </p><p>Specified text: <a href="http://example.com" class='external' title="http://example.com">link</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
182 </p><p>Trail (not sure if this is meant to work): <a href="http://example.com" class='external' title="http://example.com">link</a>s<span class='urlexpansion'> (<i>http://example.com</i>)</span>
191 Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345]
192 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
193 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
194 Link to non-http image, no img tag: ftp://example.com/test.jpg
195 Terminating separator: http://example.com/thing,
196 Intervening separator: http://example.com/1,2,3
197 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
198 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
199 URL in text: [http://example.com http://example.com]
200 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
201 Old & use: http://x&y
202 Escaping without &: http://x&y
204 <p>Unrecognised characters (for no good reason): <a href="http://example.com/1" class='external'>http://example.com/1</a>$2345
205 [http://example.com/1$2345]</p>
206 <p>External image: <img src="http://example.com/test.jpg" alt="test.jpg" /></p>
207 <p>External image from https: <img src="https://example.com/test.jpg" alt="test.jpg" /></p>
208 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class='external'>ftp://example.com/test.jpg</a></p>
209 <p>Terminating separator: <a href="http://example.com/thing" class='external'>http://example.com/thing</a>,</p>
210 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external'>http://example.com/1,2,3</a></p>
211 <p>Old bug with URL in query: [http://example.com/thing?url=<a href="http://example.com" class='external'>http://example.com</a>
213 <p>And again with mixed protocols: [ftp://example.com?url=<a href="http://example.com" class='external'>http://example.com</a>
215 <p>URL in text: <a href='http://example.com' class='external'></a><a href="http://example.com" class=
216 'external'>http://example.com</a> <span class='urlexpansion'>(<i>http://example.com</i>)</span></p>
217 <p>ja-style clickable images: <a href='http://example.com' class='external'><img src=
218 "http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a> <span class=
219 'urlexpansion'>(<i>http://example.com</i>)</span></p>
220 <p>Old & use: <a href="http://x&y" class='external'>http://x&y</a></p>
221 <p>Escaping without &: <a href="http://x&y" class='external'>http://x&y</a></p>
231 Normal text. '''Bold text.''' Normal text. ''Italic text.''
235 ..spanning two paragraphs (should not work).'''
237 Normal text. '''''Bold italic text.''''' Normal text.
239 '''''Bold italic text '''with bold deactivated''' in between.'''''
241 '''''Bold italic text ''with italic deactivated'' in between.'''''
243 '''Bold tag left open
245 ''Italic tag left open
249 <!-- Unmatching number of opening, closing tags: -->
250 '''This year''''s election ''should'' beat '''last year''''s.
252 ''Tom'''s car is bigger than ''Susan'''s.
254 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
255 </p><p><b>Bold text..</b>
256 </p><p>..spanning two paragraphs (should not work).
257 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
258 </p><p><i><b>Bold italic text</b> with bold deactivated <b>in between.</b></i>
259 </p><p><b><i>Bold italic text</i> with italic deactivated <i>in between.</i></b>
260 </p><p><b>Bold tag left open</b>
261 </p><p><i>Italic tag left open</i>
263 </p><p><b>This year</b>'s election <i>should</i> beat <b>last year</b>'s.
264 </p><p><i>Tom<b>s car is bigger than</b></i> <b>Susan</b>s.
274 Plain link, capitalized: [[Main Page]]
276 <p>Plain link, capitalized: <a href="/wiki/Main_Page" title ="Main Page">Main Page</a>
283 Plain link, uncapitalized: [[main Page]]
285 Piped link: [[Main Page|The Main Page]]
287 Broken link: [[Zigzagzogzagzig]]
289 Link with prefix: XXX[[main Page]], XXX[[Main Page]]
291 Link with suffix: [[Main Page]]XXX
293 Link with 3 brackets: [[[main page]]]
295 Piped link with 3 brackets: [[[main page|the main page]]]
297 Link to namespaces: [[Talk:Parser testing]], [[Meta:Disclaimers]]
299 Piped link to namespace: [[Meta:Disclaimers|The disclaimers]]
301 Link to category: [[:Category:MediaWiki User's Guide]]
303 Link to image page: [[:Image:Ncwikicol.png]]
305 Plain link to URL: [[http://www.example.org]]
307 Piped link to URL: [[http://www.example.org|an example URL]]
309 </p><p>Plain link, uncapitalized: <a href="/wiki/Main_Page">main Page</a>
310 </p><p>Piped link: <a href="/wiki/Main_Page">The Main Page</a></p>
311 <p>Broken link: <a href="/w/wiki.phtml?title=Zigzagzogzagzig&action=edit" class="new">Zigzagzogzagzig</a></p>
312 <p>Link with prefix: xxx<a href="/wiki/Main_Page">main Page</a>, xxx<a href="/wiki/Main_Page">Main Page</a>, Xxx<a href=
313 "/wiki/Main_Page">main Page</a> XXX<a href="/wiki/Main_Page">main Page</a>, XXX<a href="/wiki/Main_Page">Main Page</a></p>
314 <p>Link with suffix: <a href="/wiki/Main_Page">Main Pagexxx</a>, <a href="/wiki/Main_Page">Main Page</a>XXX</p>
315 <p>Link with 3 brackets: [[[main page]]]</p>
316 <p>Piped link with 3 brackets: [[[main page|the main page]]]</p>
317 <p>Link to namespaces: <a href="/w/wiki.phtml?title=Talk:Parser_testing&action=edit" class="new">Talk:Parser testing</a>,
318 <a href="/w/wiki.phtml?title=Meta:Disclaimers&action=edit" class="new">Meta:Disclaimers</a></p>
319 <p>Piped link to namespace: <a href="/w/wiki.phtml?title=Meta:Disclaimers&action=edit" class="new">The disclaimers</a></p>
320 <p>Link to category: <a href="/wiki/Category:MediaWiki_User%27s_Guide">Category:MediaWiki User's Guide</a></p>
321 <p>Link to image page: <a href="/wiki/Image:Ncwikicol.png">Image:Ncwikicol.png</a></p>
322 <p>Plain link to URL: [<a href='http://www.example.org' class='external'>[1]</a> <span class=
323 'urlexpansion'>(<i>http://www.example.org</i>)</span>]</p>
324 <p>Piped link to URL: <a href="/w/wiki.phtml?title=Http://www.example.org&action=edit" class="new">an example URL</a></p>