1 # MediaWiki Parser test cases
2 # see also http://meta.wikimedia.org/wiki/Parser_testing
13 This is a simple paragraph.
15 <p>This is a simple paragraph.
34 * plain''italic''plain
35 * plain''italic''plain''italic''plain
36 * plain'''bold'''plain
37 * plain'''bold'''plain'''bold'''plain
38 * plain''italic''plain'''bold'''plain
39 * plain'''bold'''plain''italic''plain
40 * plain''italic'''bold-italic'''italic''plain
41 * plain'''bold''bold-italic''bold'''plain
42 * plain'''''bold-italic'''italic''plain
43 * plain'''''bold-italic''bold'''plain
44 * plain''italic'''bold-italic'''''plain
45 * plain'''bold''bold-italic'''''plain
46 * plain l'''italic''plain
49 </li><li> plain<i>italic</i>plain
50 </li><li> plain<i>italic</i>plain<i>italic</i>plain
51 </li><li> plain<b>bold</b>plain
52 </li><li> plain<b>bold</b>plain<b>bold</b>plain
53 </li><li> plain<i>italic</i>plain<b>bold</b>plain
54 </li><li> plain<b>bold</b>plain<i>italic</i>plain
55 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
56 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
57 </li><li> plain<i><b>bold-italic</b>italic</i>plain
58 </li><li> plain<b><i>bold-italic</i>bold</b>plain
59 </li><li> plain<i>italic<b>bold-italic</b></i>plain
60 </li><li> plain<b>bold<i>bold-italic</i></b>plain
61 </li><li> plain l'<i>italic</i>plain
66 ### <nowiki> test cases
70 <nowiki> unordered list
72 <nowiki>* This is not an unordered list item.</nowiki>
74 <p>* This is not an unordered list item.
81 <nowiki>Lorem ipsum dolor
102 :There is not nowiki.
103 :There is <nowiki>nowiki</nowiki>.
105 #There is not nowiki.
106 #There is <nowiki>nowiki</nowiki>.
108 *There is not nowiki.
109 *There is <nowiki>nowiki</nowiki>.
111 <dl><dd>There is not nowiki.
112 </dd><dd>There is nowiki.
114 <ol><li>There is not nowiki.
115 </li><li>There is nowiki.
117 <ul><li>There is not nowiki.
118 </li><li>There is nowiki.
123 ### comment test cases
128 <!-- comment 1 --> asdf
163 asdf<!-- comment 1 -->jkl
173 External links: non-bracketed
175 Non-bracketed: http://example.com
177 <p>Non-bracketed: <a href="http://example.com" class='external'>http://example.com</a>
182 External links: numbered
184 Numbered: [http://example.com]
186 <p>Numbered: <a href="http://example.com" class='external' title="http://example.com">[1]</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
191 External links: specified text
193 Specified text: [http://example.com link]
195 <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>
200 External links: trail
202 Trail (not sure if this is meant to work): [http://example.com link]s
204 <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>
209 External links: dollar sign in URL
211 http://example.com/1$2345
213 <p><a href="http://example.com/1$2345" class='external'>http://example.com/1$2345</a>
218 External links: dollar sign in URL (named)
220 [http://example.com/1$2345]
222 <p><a href="http://example.com/1$2345" class='external' title="http://example.com/1$2345">[1]</a><span class='urlexpansion'> (<i>http://example.com/1$2345</i>)</span>
229 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
231 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
236 External image from https
238 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
240 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
245 Link to non-http image, no img tag
247 Link to non-http image, no img tag: ftp://example.com/test.jpg
249 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class='external'>ftp://example.com/test.jpg</a>
254 External links: terminating separator
256 Terminating separator: http://example.com/thing,
258 <p>Terminating separator: <a href="http://example.com/thing" class='external'>http://example.com/thing</a>,
263 External links: intervening separator
265 Intervening separator: http://example.com/1,2,3
267 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external'>http://example.com/1,2,3</a>
272 External links: old bug with URL in query
274 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
276 <p>Old bug with URL in query: <a href="http://example.com/thing?url=http://example.com" class='external' title="http://example.com/thing?url=http://example.com">link</a><span class='urlexpansion'> (<i>http://example.com/thing?url=http://example.com</i>)</span>
281 External links: old URL-in-URL bug, mixed protocols
283 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
285 <p>And again with mixed protocols: <a href="ftp://example.com?url=http://example.com" class='external' title="ftp://example.com?url=http://example.com">link</a><span class='urlexpansion'> (<i>ftp://example.com?url=http://example.com</i>)</span>
290 External links: URL in text
292 URL in text: [http://example.com http://example.com]
294 <p>URL in text: <a href="http://example.com" class='external'>http://example.com</a>
299 External links: Clickable images
301 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
303 <p>ja-style clickable images: <a href="http://example.com" class='external' title="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
308 External links: raw ampersand
310 Old & use: http://x&y
312 <p>Old & use: <a href="http://x&y" class='external'>http://x&y</a>
324 Normal text. '''Bold text.''' Normal text. ''Italic text.''
326 Normal text. '''''Bold italic text.''''' Normal text.
328 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
329 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
335 Unclosed and unmatched quotes
337 '''''Bold italic text '''with bold deactivated''' in between.'''''
339 '''''Bold italic text ''with italic deactivated'' in between.'''''
343 ..spanning two paragraphs (should not work).'''
345 '''Bold tag left open
347 ''Italic tag left open
351 <!-- Unmatching number of opening, closing tags: -->
352 '''This year''''s election ''should'' beat '''last year''''s.
354 ''Tom'''s car is bigger than ''Susan'''s.
356 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
357 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
358 </p><p><b>Bold text..</b>
359 </p><p>..spanning two paragraphs (should not work).<b></b>
360 </p><p><b>Bold tag left open</b>
361 </p><p><i>Italic tag left open</i>
363 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
364 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
374 Plain link, capitalized: [[Main Page]]
376 Plain link, uncapitalized: [[main Page]]
378 <p>Plain link, capitalized: <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
379 </p><p>Plain link, uncapitalized: <a href="/wiki/Main_Page" title="Main Page">main Page</a>
388 Piped link: [[Main Page|The Main Page]]
390 Broken link: [[Zigzagzogzagzig]]
392 Link with prefix: XXX[[main Page]], XXX[[Main Page]]
394 Link with suffix: [[Main Page]]XXX
396 Link with 3 brackets: [[[main page]]]
398 Piped link with 3 brackets: [[[main page|the main page]]]
400 Link to namespaces: [[Talk:Parser testing]], [[Meta:Disclaimers]]
402 Piped link to namespace: [[Meta:Disclaimers|The disclaimers]]
404 Link to category: [[:Category:MediaWiki User's Guide]]
406 Link to image page: [[:Image:Ncwikicol.png]]
408 Plain link to URL: [[http://www.example.org]]
410 Piped link to URL: [[http://www.example.org|an example URL]]
412 </p><p>Piped link: <a href="/wiki/Main_Page">The Main Page</a></p>
413 <p>Broken link: <a href="/w/wiki.phtml?title=Zigzagzogzagzig&action=edit" class="new">Zigzagzogzagzig</a></p>
414 <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=
415 "/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>
416 <p>Link with suffix: <a href="/wiki/Main_Page">Main Pagexxx</a>, <a href="/wiki/Main_Page">Main Page</a>XXX</p>
417 <p>Link with 3 brackets: [[[main page]]]</p>
418 <p>Piped link with 3 brackets: [[[main page|the main page]]]</p>
419 <p>Link to namespaces: <a href="/w/wiki.phtml?title=Talk:Parser_testing&action=edit" class="new">Talk:Parser testing</a>,
420 <a href="/w/wiki.phtml?title=Meta:Disclaimers&action=edit" class="new">Meta:Disclaimers</a></p>
421 <p>Piped link to namespace: <a href="/w/wiki.phtml?title=Meta:Disclaimers&action=edit" class="new">The disclaimers</a></p>
422 <p>Link to category: <a href="/wiki/Category:MediaWiki_User%27s_Guide">Category:MediaWiki User's Guide</a></p>
423 <p>Link to image page: <a href="/wiki/Image:Ncwikicol.png">Image:Ncwikicol.png</a></p>
424 <p>Plain link to URL: [<a href='http://www.example.org' class='external'>[1]</a> <span class=
425 'urlexpansion'>(<i>http://www.example.org</i>)</span>]</p>
426 <p>Piped link to URL: <a href="/w/wiki.phtml?title=Http://www.example.org&action=edit" class="new">an example URL</a></p>