# MediaWiki Parser test cases # see also http://meta.wikimedia.org/wiki/Parser_testing !! test Blank input !! input !! result !! end !! test Simple paragraph !! input This is a simple paragraph. !! result

This is a simple paragraph.

!! end !! test Simple list !! input * Item 1 * Item 2 !! result !! end !! test Italics and bold !! input * plain * plain''italic''plain * plain''italic''plain''italic''plain * plain'''bold'''plain * plain'''bold'''plain'''bold'''plain * plain''italic''plain'''bold'''plain * plain'''bold'''plain''italic''plain * plain''italic'''bold-italic'''italic''plain * plain'''bold''bold-italic''bold'''plain * plain'''''bold-italic'''italic''plain * plain'''''bold-italic''bold'''plain * plain''italic'''bold-italic'''''plain * plain'''bold''bold-italic'''''plain * plain l'''italic''plain !! result !! end ### ### test cases ### !! test unordered list !! input * This is not an unordered list item. !! result

* This is not an unordered list item.

!! end !! test spacing !! input Lorem ipsum dolor sed abit. sed nullum. :and a colon !! result

Lorem ipsum dolor sed abit. sed nullum. :and a colon

!! end !! test nowiki 3 !! input :There is not nowiki. :There is nowiki. #There is not nowiki. #There is nowiki. *There is not nowiki. *There is nowiki. !! result
There is not nowiki.
There is nowiki.
  1. There is not nowiki.
  2. There is nowiki.
  • There is not nowiki.
  • There is nowiki.
!! end ### ### comment test cases ### !! test comment test 1 !! input asdf !! result
asdf
!! end !! test comment test 2 !! input asdf jkl !! result

asdf jkl

!! end !! test comment test 3 !! input asdf jkl !! result

asdf jkl

!! end !! test comment test 4 !! input asdfjkl !! result

asdfjkl

!! end ### ### External links ### !! test External links 1-4 !! input Non-bracketed: http://example.com Numbered: [http://example.com] Specified text: [http://example.com link] Trail (not sure if this is meant to work): [http://example.com link]s !! result

Non-bracketed: http://example.com

Numbered: [1] (http://example.com)

Specified text: link (http://example.com)

Trail (not sure if this is meant to work): links (http://example.com)

!! end # todo: enable these !! test !! disabled External links !! input Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345] External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png Link to non-http image, no img tag: ftp://example.com/test.jpg Terminating separator: http://example.com/thing, Intervening separator: http://example.com/1,2,3 Old bug with URL in query: [http://example.com/thing?url=http://example.com link] And again with mixed protocols: [ftp://example.com?url=http://example.com link] URL in text: [http://example.com http://example.com] ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] Old & use: http://x&y Escaping without &: http://x&y !! result

Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345]

External image: test.jpg

External image from https: test.jpg

Link to non-http image, no img tag: ftp://example.com/test.jpg

Terminating separator: http://example.com/thing,

Intervening separator: http://example.com/1,2,3

Old bug with URL in query: [http://example.com/thing?url=http://example.com link]

And again with mixed protocols: [ftp://example.com?url=http://example.com link]

URL in text: http://example.com (http://example.com)

ja-style clickable images: Ncwikicol.png (http://example.com)

Old & use: http://x&y

Escaping without &: http://x&y

!! end ### ### Quotes ### !! test Quotes !! input Normal text. '''Bold text.''' Normal text. ''Italic text.'' Normal text. '''''Bold italic text.''''' Normal text. !!result

Normal text. Bold text. Normal text. Italic text.

Normal text. Bold italic text. Normal text.

!! end !! test Unclosed and unmatched quotes !! input '''''Bold italic text '''with bold deactivated''' in between.''''' '''''Bold italic text ''with italic deactivated'' in between.''''' '''Bold text.. ..spanning two paragraphs (should not work).''' '''Bold tag left open ''Italic tag left open Normal text. '''This year''''s election ''should'' beat '''last year''''s. ''Tom'''s car is bigger than ''Susan'''s. !! result

Bold italic text with bold deactivated in between.

Bold italic text with italic deactivated in between.

Bold text..

..spanning two paragraphs (should not work).

Bold tag left open

Italic tag left open

Normal text.

This year's election should beat last year's.

Toms car is bigger than Susans.

!! end ### ### Internal links ### !! test Internal links !! input Plain link, capitalized: [[Main Page]] Plain link, uncapitalized: [[main Page]] !! result

Plain link, capitalized: Main Page

Plain link, uncapitalized: main Page

!! end !! test Internal links 2 !! disabled !!input Piped link: [[Main Page|The Main Page]] Broken link: [[Zigzagzogzagzig]] Link with prefix: XXX[[main Page]], XXX[[Main Page]] Link with suffix: [[Main Page]]XXX Link with 3 brackets: [[[main page]]] Piped link with 3 brackets: [[[main page|the main page]]] Link to namespaces: [[Talk:Parser testing]], [[Meta:Disclaimers]] Piped link to namespace: [[Meta:Disclaimers|The disclaimers]] Link to category: [[:Category:MediaWiki User's Guide]] Link to image page: [[:Image:Ncwikicol.png]] Plain link to URL: [[http://www.example.org]] Piped link to URL: [[http://www.example.org|an example URL]] !! result

Piped link: The Main Page

Broken link: Zigzagzogzagzig

Link with prefix: xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page

Link with suffix: Main Pagexxx, Main PageXXX

Link with 3 brackets: [[[main page]]]

Piped link with 3 brackets: [[[main page|the main page]]]

Link to namespaces: Talk:Parser testing, Meta:Disclaimers

Piped link to namespace: The disclaimers

Link to category: Category:MediaWiki User's Guide

Link to image page: Image:Ncwikicol.png

Plain link to URL: [[1] (http://www.example.org)]

Piped link to URL: an example URL

!! end