From: Gabriel Wicke
Non-bracketed: http://example.com -
+Numbered: [1] -Numbered: [2] -Numbered: [3] -
-!!end +Specified text: link -
-!!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 -Linktrails should not work for external links: links -
+[1] -
-!!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: +## +##http://example.com/1[2345 -
+[2345 -
-!!end +[http://example.com/ first -second] -
-!!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 -Test -
+[1] -
+//example.com/Foo -
-!!end !! test -External links: protocol-relative URL in the middle of a word is left alone (bug 30269) +Definition Lists: Mixed Lists: Test 1 !! input -foo//example.com/Foo +:;* foo +::* bar +:; baz !! result -foo//example.com/Foo -
+External image:
-
External image from https:
-
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: link -
+And again with mixed protocols: link -
-!!end !! test -External links: URL in text +Definition Lists: Mixed Lists: Test 8 !! input -URL in text: [http://example.com http://example.com] +:* d1 +::* d2 !! result -URL in text: http://example.com -
+Old & use: http://x&y -
+Old & use: http://x&y -
+Old & use: [1] +
Non-bracketed: http://example.com
!! end !! test -External links: [encoded ampersand] +External links: numbered !! input -Old & use: [http://x&y] +Numbered: [http://example.com] +Numbered: [http://example.net] +Numbered: [http://example.com] !! result -Old & use: [1] +
Numbered: [1] +Numbered: [2] +Numbered: [3]
-!! end +!!end !! test -External links: [encoded equals] (bug 6102) +External links: specified text !! input -[http://example.com/?foo=bar] +Specified text: [http://example.com link] !! result -[1] +
Specified text: link
-!! end +!!end !! test -External links: [IDN ignored character reference in hostname; strip it right off] +External links: trail !! input -[http://example.com/] +Linktrails should not work for external links: [http://example.com link]s !! result -[1] +
Linktrails should not work for external links: links
!! end !! test -External links: IDN ignored character reference in hostname; strip it right off +External links: dollar sign in URL !! input -http://example.com/ +http://example.com/1$2345 !! result - !! end !! test -External links: www.jpeg.org (bug 554) +External links: dollar sign in URL (named) !! input -http://www.jpeg.org -!!result -http://www.jpeg.org +[http://example.com/1$2345] +!! result +
-!! end +!!end !! test -External links: URL within URL (original bug 2) +External links: open square bracket forbidden in URL (bug 4377) !! input -[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] +http://example.com/1[2345 !! result -[1] +
http://example.com/1[2345
!! end !! test -BUG 361: URL inside bracketed URL +External links: open square bracket forbidden in URL (named) (bug 4377) !! input -[http://www.example.com/foo http://www.example.com/bar] +[http://example.com/1[2345] !! result - -!! end +!!end !! test -BUG 361: URL within URL, not bracketed -!! input -http://www.example.com/foo?=http://www.example.com/bar +External links: nowiki in URL link text (bug 6230) +!!input +[http://example.com/http://www.example.com/foo?=http://www.example.com/bar +
!! end !! test -BUG 289: ">"-token in URL-tail +External links: newline forbidden in text (bug 6230 regression check) !! input -http://www.example.com/http://www.example.com/<hello> +
[http://example.com/ first +second]
!!end !! test -BUG 289: literal ">"-token in URL-tail +External links: protocol-relative URL in brackets !! input -http://www.example.com/html +[//example.com/ Test] !! result -http://www.example.com/html +
-!!end +!! end !! test -BUG 289: ">"-token in bracketed URL +External links: protocol-relative URL in brackets without text !! input -[http://www.example.com///example.com/Foo
!!end !! test -BUG 289: literal double quote at end of URL +External links: protocol-relative URL in the middle of a word is left alone (bug 30269) !! input -http://www.example.com/"hello" +foo//example.com/Foo !! result -http://www.example.com/"hello" +
foo//example.com/Foo +
+!! end + +!! test +External image +!! input +External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png +!! result +External image:
+
External image from https:
+
Link to non-http image, no img tag: ftp://example.com/test.jpg +
+!! end + +!! test +External links: terminating separator +!! input +Terminating separator: http://example.com/thing, +!! result +Terminating separator: http://example.com/thing, +
+!! end + +!! test +External links: intervening separator +!! input +Intervening separator: http://example.com/1,2,3 +!! result +Intervening separator: http://example.com/1,2,3 +
+!! end + +!! test +External links: old bug with URL in query +!! input +Old bug with URL in query: [http://example.com/thing?url=http://example.com link] +!! result +Old bug with URL in query: link +
+!! end + +!! test +External links: old URL-in-URL bug, mixed protocols +!! input +And again with mixed protocols: [ftp://example.com?url=http://example.com link] +!! result +And again with mixed protocols: link +
+!!end + +!! test +External links: URL in text +!! input +URL in text: [http://example.com http://example.com] +!! result +URL in text: http://example.com +
+!! end + +!! test +External links: Clickable images +!! input +ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] +!! result + +!!end + +!! test +External links: raw ampersand +!! input +Old & use: http://x&y +!! result +Old & use: http://x&y +
+!! end + +!! test +External links: encoded ampersand +!! input +Old & use: http://x&y +!! result +Old & use: http://x&y +
+!! end + +!! test +External links: encoded equals (bug 6102) +!! input +http://example.com/?foo=bar +!! result + +!! end + +!! test +External links: [raw ampersand] +!! input +Old & use: [http://x&y] +!! result +Old & use: [1] +
+!! end + +!! test +External links: [encoded ampersand] +!! input +Old & use: [http://x&y] +!! result +Old & use: [1] +
+!! end + +!! test +External links: [encoded equals] (bug 6102) +!! input +[http://example.com/?foo=bar] +!! result +[1] +
+!! end + +!! test +External links: [IDN ignored character reference in hostname; strip it right off] +!! input +[http://example.com/] +!! result +[1] +
+!! end + +!! test +External links: IDN ignored character reference in hostname; strip it right off +!! input +http://example.com/ +!! result + +!! end + +!! test +External links: www.jpeg.org (bug 554) +!! input +http://www.jpeg.org +!!result + +!! 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 +[1] +
+!! end + +!! test +BUG 361: URL inside bracketed URL +!! input +[http://www.example.com/foo http://www.example.com/bar] +!! result + +!! end + +!! test +BUG 361: URL within URL, not bracketed +!! input +http://www.example.com/foo?=http://www.example.com/bar +!! result +http://www.example.com/foo?=http://www.example.com/bar +
+!! end + +!! test +BUG 289: ">"-token in URL-tail +!! input +http://www.example.com/http://www.example.com/<hello> +
+!!end + +!! test +BUG 289: literal ">"-token in URL-tail +!! input +http://www.example.com/html +!! result +http://www.example.com/html +
+!!end + +!! test +BUG 289: ">"-token in bracketed URL +!! input +[http://www.example.com/http://www.example.com/"hello"
!!end @@ -7676,2511 +8047,2144 @@ foobar.jpgJavaScript -
-!! end - -!! test -HTML Hex character encoding bogus encoding (bug 26437 regression check) -!! input -see;SEE; -!! result -&#xsee;&#XSEE; -
-!! end - -!! test -HTML Hex character encoding mixed case -!! input -îî -!! result -îî -
-!! end - -!! test -__FORCETOC__ override -!! input -__NEWSECTIONLINK__ -__FORCETOC__ -!! result -
-
ISBN 978-0-1234-56 789 -
-!! end - -!! test -ISBN followed by 5 spaces -!! input -ISBN -!! result -ISBN -
-!! end - -!! test -Double ISBN -!! input -ISBN ISBN 1234567890 -!! result -ISBN ISBN 1234567890 -
-!! end - -!! test -Bug 22905: followed by ISBN followed by -!! input -(fr) ISBN 2753300917 [http://www.example.com example.com] -!! result -(fr) ISBN 2753300917 example.com -
-!! end - -!! test -Double RFC -!! input -RFC RFC 1234 -!! result -RFC RFC 1234 -
-!! end - -!! test -Double RFC with a wiki link -!! input -RFC [[RFC 1234]] -!! result -RFC RFC 1234 -
-!! end - -!! test -RFC code coverage -!! input -RFC 983 987 -!! result -RFC 983 987 -
-!! end - -!! test -Centre-aligned image -!! input -[[Image:foobar.jpg|centre]] -!! result - - -!!end - -!! test -None-aligned image -!! input -[[Image:foobar.jpg|none]] -!! result - - -!!end - -!! test -Width + Height sized image (using px) (height is ignored) -!! input -[[Image:foobar.jpg|640x480px]] -!! result - -!!end - -!! test -Width-sized image (using px, no following whitespace) -!! input -[[Image:foobar.jpg|640px]] -!! result - -!!end - -!! test -Width-sized image (using px, with following whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg|640px ]] -!! result - -!!end - -!! test -Width-sized image (using px, with preceding whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg| 640px]] -!! result - -!!end - -!! test -Another italics / bold test -!! input - ''' ''x' -!! result -' x' --!!end - -# Note the results may be incorrect, as parserTest output included this: -# XML error: Mismatched tag at byte 6120: -# ...
<html><script>alert(1);</script></html> -
-!! end - -!! test -HTML with raw HTML ($wgRawHtml==true) -!! options -rawhtml -!! input - -!! result --
-!! end - -!! test -Parents of subpages, one level up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../|L2]] -!! result -L2 -
-!! end - - -!! test -Parents of subpages, one level up, not named -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../]] -!! result - -!! end - - - -!! test -Parents of subpages, two levels up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../|L1]]2 - -[[../../|L1]]l -!! result -L12 -
L1l -
-!! end - -!! test -Parents of subpages, two levels up, without trailing slash or name. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../..]] -!! result -[[../..]] -
-!! end - -!! test -Parents of subpages, two levels up, with lots of extra trailing slashes. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../////]] -!! result -/// -
+ + !! end !! test -Definition list code coverage +HTML Hex character encoding (spells the word "JavaScript") !! input -; title : def -; title : def -;title: def +JavaScript !! result -JavaScript +
!! end !! test -Don't fall for the self-closing div +HTML Hex character encoding bogus encoding (bug 26437 regression check) !! input -&#xsee;&#XSEE; +
!! end !! test -MSGNW magic word +HTML Hex character encoding mixed case !! input -{{MSGNW:msg}} +îî !! result -[[:Template:Msg]] +
îî
!! end !! test -RAW magic word -!! input -{{RAW:QUERTY}} +__FORCETOC__ override +!! input +__NEWSECTIONLINK__ +__FORCETOC__ !! result -
><> +
!! end !! test -Template caching +ISBN followed by 5 spaces !! input -{{Test}} -{{Test}} +ISBN !! result -This is a test template -This is a test template +
ISBN
!! end - -!! article -MediaWiki:Fake -!! text -==header== -!! endarticle - !! test -Inclusion of !userCanEdit() content +Double ISBN !! input -{{MediaWiki:Fake}} +ISBN ISBN 1234567890 !! result -ISBN ISBN 1234567890 +
!! end - !! test -Out-of-order TOC heading levels +Bug 22905: followed by ISBN followed by !! input -==2== -======6====== -===3=== -=1= -=====5===== -==2== +(fr) ISBN 2753300917 [http://www.example.com example.com] !! result -Contents |
(fr) ISBN 2753300917 example.com +
!! end - !! test -ISBN with a dummy number +Double RFC !! input -ISBN --- +RFC RFC 1234 !! result -ISBN --- +
RFC RFC 1234
!! end - !! test -ISBN with space-delimited number +Double RFC with a wiki link !! input -ISBN 92 9017 032 8 +RFC [[RFC 1234]] !! result -RFC RFC 1234
!! end - !! test -ISBN with multiple spaces, no number +RFC code coverage !! input -ISBN foo +RFC 983 987 !! result -ISBN foo +
RFC 983 987
!! end - !! test -ISBN length +Centre-aligned image !! input -ISBN 123456789 - -ISBN 1234567890 - -ISBN 12345678901 +[[Image:foobar.jpg|centre]] !! result -ISBN 123456789 -
ISBN 12345678901 -
-!! end + +!!end !! test -ISBN with trailing year (bug 8110) +None-aligned image !! input -ISBN 1-234-56789-0 - 2006 - -ISBN 1 234 56789 0 - 2006 +[[Image:foobar.jpg|none]] !! result -ISBN 1-234-56789-0 - 2006 -
ISBN 1 234 56789 0 - 2006 -
-!! end + +!!end !! test -anchorencode +Width + Height sized image (using px) (height is ignored) !! input -{{anchorencode:foo bar©#%n}} +[[Image:foobar.jpg|640x480px]] !! result -foo_bar.C2.A9.23.25n +
-!! end +!!end !! test -anchorencode trims spaces +Width-sized image (using px, no following whitespace) !! input -{{anchorencode: __pretty__please__}} +[[Image:foobar.jpg|640px]] !! result -pretty_please +
-!! end +!!end !! test -anchorencode deals with links +Width-sized image (using px, with following whitespace - test regression from r39467) !! input -{{anchorencode: [[hello|world]] [[hi]]}} +[[Image:foobar.jpg|640px ]] !! result -world_hi +
-!! end +!!end !! test -anchorencode deals with templates +Width-sized image (using px, with preceding whitespace - test regression from r39467) !! input -{{anchorencode: {{Foo}} }} +[[Image:foobar.jpg| 640px]] !! result -FOO +
-!! end +!!end !! test -anchorencode encodes like the TOC generator: (bug 18431) +Another italics / bold test !! input -=== _ +:.3A%3A&&]] === -{{anchorencode: _ +:.3A%3A&&]] }} -__NOEDITSECTION__ + ''' ''x' !! result -.2B:.3A.253A.26.26.5D.5D -
-!! end +' x' ++!!end -# Expected output in the following test is not necessarily expected (there -# should probably be
tags inside the
in the output) -- it's -# only testing for well-formedness. +# Note the results may be incorrect, as parserTest output included this: +# XML error: Mismatched tag at byte 6120: +# ...+:;;;:: +!! result +-foo -
-foo --
bar -
-baz --!! end +# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. !! test -Bug 8293: Use of center tag ruins paragraph formatting +Images with the "|" character in the comment !! input -
foo -
-bar +
<html><script>alert(1);</script></html>
-baz -!! end - -### -### Language variants related tests -### !! test -Self-link in language variants +HTML with raw HTML ($wgRawHtml==true) !! options -title=[[Dunav]] language=sr +rawhtml !! input -Both [[Dunav]] and [[ÐÑнав]] are names for this river. + !! result -
Both Dunav and ÐÑнав are names for this river. +
-!!end - +!! end !! test -Link to pages in language variants +Parents of subpages, one level up !! options -language=sr +subpage title=[[Subpage test/L1/L2/L3]] !! input -Main Page can be written as [[Ðаин Ðаге]] +[[../|L2]] !! result -
Main Page can be written as Ðаин Ðаге +
-!!end +!! end !! test -Multiple links to pages in language variants +Parents of subpages, one level up, not named !! options -language=sr +subpage title=[[Subpage test/L1/L2/L3]] !! input -[[Main Page]] can be written as [[Ðаин Ðаге]] same as [[Ðаин Ðаге]]. +[[../]] !! result -Main Page can be written as Ðаин Ðаге same as Ðаин Ðаге. +
-!!end +!! end + !! test -Simple template in language variants +Parents of subpages, two levels up !! options -language=sr +subpage title=[[Subpage test/L1/L2/L3]] !! input -{{ÑеÑÑ}} +[[../../|L1]]2 + +[[../../|L1]]l !! result -This is a test template +
L12 +
!! end - !! test -Template with explicit namespace in language variants +Parents of subpages, two levels up, without trailing slash or name. !! options -language=sr +subpage title=[[Subpage test/L1/L2/L3]] !! input -{{Template:ÑеÑÑ}} +[[../..]] !! result -This is a test template +
[[../..]]
!! end - !! test -Basic test for template parameter in language variants +Parents of subpages, two levels up, with lots of extra trailing slashes. !! options -language=sr +subpage title=[[Subpage test/L1/L2/L3]] !! input -{{паÑамÑеÑÑ|param=foo}} +[[../../////]] !! result -This is a test template with parameter foo +
!! end - !! test -Simple category in language variants -!! options -language=sr cat +Definition list code coverage !! input -[[Category:ÐедиаWики УÑеÑ'Ñ ÐÑиде]] +; title : def +; title : def +;title: def !! result -MediaWiki User's Guide +Latin proverb: Ne nuntium necare +
[[:Template:Msg]]
!! end - !! test -Prevent conversion with -{}- tags (language variants) -!! options -language=sr variant=sr-ec +RAW magic word !! input -Latinski: -{Ne nuntium necare}- +{{RAW:QUERTY}} !! result -ÐаÑинÑки: Ne nuntium necare +
!! end - +# This isn't needed for XHTML conformance, but would be handy as a fallback security measure !! test -Prevent conversion of text with -{}- tags (language variants) -!! options -language=sr variant=sr-ec +Always escape literal '>' in output, not just after '<' !! input -Latinski: -{Ne nuntium necare}- +><> !! result -ÐаÑинÑки: Ne nuntium necare +
><>
!! end - !! test -Prevent conversion of links with -{}- tags (language variants) -!! options -language=sr variant=sr-ec +Template caching !! input --{[[Main Page]]}- +{{Test}} +{{Test}} !! result -This is a test template +This is a test template
!! end +!! article +MediaWiki:Fake +!! text +==header== +!! endarticle + !! test --{}- tags within headlines (within html for parserConvert()) -!! options -language=sr variant=sr-ec +Inclusion of !userCanEdit() content !! input -== -{Naslov}- == +{{MediaWiki:Fake}} !! result -Taiwan, not China -
+Contents |
Taiwan is not China. -But Taiwan is Taiwan, -(This should be stripped!) -and China is China. +
ISBN ---
!! end + !! test -Explicit session-wise language variant mapping (H flag for hide) -!! options -language=zh variant=zh-tw +ISBN with space-delimited number !! input -(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!) -Taiwan is China. +ISBN 92 9017 032 8 !! result -(This should be stripped!) -Taiwan is Taiwan. +
!! end + !! test -Adding explicit conversion rule for title (T flag) -!! options -language=zh variant=zh-tw showtitle +ISBN with multiple spaces, no number !! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! +ISBN foo !! result -Taiwan -Should be stripped! +
ISBN foo
!! end + !! test -Testing that changing the language variant here in the tests actually works -!! options -language=zh variant=zh showtitle +ISBN length !! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! +ISBN 123456789 + +ISBN 1234567890 + +ISBN 12345678901 !! result -China -Should be stripped! +
ISBN 123456789 +
ISBN 12345678901
!! end + !! test -Bug 24072: more test on conversion rule for title -!! options -language=zh variant=zh-tw showtitle +ISBN with trailing year (bug 8110) !! input -This should be stripped-{T|zh:China;zh-tw:Taiwan}-! -This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-. +ISBN 1-234-56789-0 - 2006 + +ISBN 1 234 56789 0 - 2006 !! result -Taiwan -This should be stripped! -This won't take interferes with the title rule. +
ISBN 1-234-56789-0 - 2006 +
ISBN 1 234 56789 0 - 2006
!! end + !! test -Raw output of variant escape tags (R flag) -!! options -language=zh variant=zh-tw +anchorencode !! input -Raw: -{R|zh:China;zh-tw:Taiwan}- +{{anchorencode:foo bar©#%n}} !! result -Raw: zh:China;zh-tw:Taiwan +
foo_bar.C2.A9.23.25n
!! end !! test -Nested using of manual convert syntax -!! options -language=zh variant=zh-hk +anchorencode trims spaces !! input -Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-! +{{anchorencode: __pretty__please__}} !! result -Nested: Hello Hong Kong! +
pretty_please
!! end !! test -Do not convert roman numbers to language variants -!! options -language=sr variant=sr-ec +anchorencode deals with links !! input -Fridrih IV je car. +{{anchorencode: [[hello|world]] [[hi]]}} !! result -ФÑидÑÐ¸Ñ IV Ñе ÑаÑ. +
world_hi
!! end !! test -Unclosed language converter markup "-{" -!! options -language=sr +anchorencode deals with templates !! input --{T|hello +{{anchorencode: {{Foo}} }} !! result --{T|hello +
FOO
!! end !! test -Don't convert raw rule "-{R|=>}-" to "=>" -!! options -language=sr +anchorencode encodes like the TOC generator: (bug 18431) !! input --{R|=>}- -!! result -=> +=== _ +:.3A%3A&&]] === +{{anchorencode: _ +:.3A%3A&&]] }} +__NOEDITSECTION__ +!! result +
.2B:.3A.253A.26.26.5D.5D
-!!end - -!!article -Template:Bullet -!!text -* Bar -!!endarticle +!! end +# Expected output in the following test is not necessarily expected (there +# should probably betags inside the
in the output) -- it's +# only testing for well-formedness. !! test -Bug 529: Uncovered bullet +Bug 6200: blockquotes and paragraph formatting !! input -* Foo {{bullet}} -!! result -+
- Foo -
- Bar -
+foo ++bar + + baz +!! result ++foo ++bar +
+baz +!! end !! test -Bug 529: Uncovered table already at line-start +Bug 8293: Use of center tag ruins paragraph formatting !! input -x ++foo + -{{table}} -y +bar + + baz !! result -x +
+ +foo
--
-- -1 -2 - - 3 -4 - y +
bar
+baz +!! end + +### +### Language variants related tests +### !! test -Bug 529: Uncovered bullet in parser function result +Self-link in language variants +!! options +title=[[Dunav]] language=sr !! input -* Foo {{lc:{{bullet}} }} +Both [[Dunav]] and [[ÐÑнав]] are names for this river. !! result -+
- Foo -
- bar -
Both Dunav and ÐÑнав are names for this river. +
+!!end -!! end !! test -Bug 5678: Double-parsed template argument +Link to pages in language variants +!! options +language=sr !! input -{{lc:{{{1}}}|hello}} +Main Page can be written as [[Ðаин Ðаге]] !! result -{{{1}}} +
Main Page can be written as Ðаин Ðаге
-!! end +!!end + !! test -Bug 5678: Double-parsed template invocation +Multiple links to pages in language variants +!! options +language=sr !! input -{{lc:{{paramtest {{!}} param = hello }} }} +[[Main Page]] can be written as [[Ðаин Ðаге]] same as [[Ðаин Ðаге]]. !! result -{{paramtest | param = hello }} +
Main Page can be written as Ðаин Ðаге same as Ðаин Ðаге.
-!! end +!!end + !! test -Case insensitivity of parser functions for non-ASCII characters (bug 8143) +Simple template in language variants !! options -language=cs -title=[[Main Page]] +language=sr !! input -{{PRVNÃVELKÃ:ÄÅ¡ÄÅ}} -{{prvnÃvelké:ÄÅ¡ÄÅ}} -{{PRVNÃMALÃ:ÄÅ¡ÄÅ}} -{{prvnÃmalé:ÄÅ¡ÄÅ}} -{{MALÃ:ÄÅ¡ÄÅ}} -{{malá:ÄÅ¡ÄÅ}} -{{VELKÃ:ÄÅ¡ÄÅ}} -{{velká:ÄÅ¡ÄÅ}} +{{ÑеÑÑ}} !! result -ÄÅ¡ÄÅ -ÄÅ¡ÄÅ -ÄÅ¡ÄÅ -ÄÅ¡ÄÅ -ÄÅ¡ÄÅ -ÄÅ¡ÄÅ -ÄÅ ÄÅ -ÄÅ ÄÅ +
This is a test template
!! end + !! test -Morwen/13: Unclosed link followed by heading +Template with explicit namespace in language variants +!! options +language=sr !! input -[[link -==heading== +{{Template:ÑеÑÑ}} !! result -[[link +
This is a test template
-[edit] heading
- !! end + !! test -HHP2.1: Heuristics for headings in preprocessor parenthetical structures +Basic test for template parameter in language variants +!! options +language=sr !! input -{{foo| -=heading= +{{паÑамÑеÑÑ|param=foo}} !! result -{{foo| +
This is a test template with parameter foo
-heading
- !! end + !! test -HHP2.2: Heuristics for headings in preprocessor parenthetical structures +Simple category in language variants +!! options +language=sr cat !! input -{{foo| -==heading== +[[Category:ÐедиаWики УÑеÑ'Ñ ÐÑиде]] !! result -{{foo| -
-[edit] heading
- +MediaWiki User's Guide !! end + !! test -Tildes in comments +Stripping -{}- tags (language variants) !! options -pst +language=sr !! input - +Latin proverb: -{Ne nuntium necare}- !! result - +Latin proverb: Ne nuntium necare +
!! end + !! test -Paragraphs inside divs (no extra line breaks) +Prevent conversion with -{}- tags (language variants) +!! options +language=sr variant=sr-ec !! input -Line one - -Line two+Latinski: -{Ne nuntium necare}- !! result -Line one -Line two- +ÐаÑинÑки: Ne nuntium necare +
!! end + !! test -Paragraphs inside divs (extra line break on open) +Prevent conversion of text with -{}- tags (language variants) +!! options +language=sr variant=sr-ec !! input --Line one - -Line two+Latinski: -{Ne nuntium necare}- !! result --- !! end + !! test -Paragraphs inside divs (extra line break on close) +Prevent conversion of links with -{}- tags (language variants) +!! options +language=sr variant=sr-ec !! input -Line one +
ÐаÑинÑки: Ne nuntium necare
-Line twoLine one - -Line two -+-{[[Main Page]]}- !! result -Line one -- !! end + !! test -Paragraphs inside divs (extra line break on open and close) +-{}- tags within headlines (within html for parserConvert()) +!! options +language=sr variant=sr-ec !! input -Line two +
--Line one +== -{Naslov}- == +!! result ++ +!! test +Explicit definition of language variant alternatives +!! options +language=zh variant=zh-tw +!! input +-{zh:China;zh-tw:Taiwan}-, not China !! result -[ÑÑеди] Naslov
+ +!! end -Line two --- !! end + !! test -Nesting tags, paragraphs on lines which begin withLine one -
Line two +
Taiwan, not China
-+Explicit session-wise language variant mapping (A flag and - flag) !! options -disabled +language=zh variant=zh-tw !! input -A -B +Taiwan is not China. +But -{A|zh:China;zh-tw:Taiwan}- is China, +(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!) +and -{China}- is China. !! result - -A -B +
Taiwan is not China. +But Taiwan is Taiwan, +(This should be stripped!) +and China is China.
!! end -# Bug 6200:should behave likewith respect to line breaks !! test -Bug 6200: paragraphs inside blockquotes (no extra line breaks) +Explicit session-wise language variant mapping (H flag for hide) !! options -disabled +language=zh variant=zh-tw !! input -Line one - -Line two+(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!) +Taiwan is China. !! result -Line one -Line two- +(This should be stripped!) +Taiwan is Taiwan. +
!! end !! test -Bug 6200: paragraphs inside blockquotes (extra line break on open) +Adding explicit conversion rule for title (T flag) !! options -disabled +language=zh variant=zh-tw showtitle !! input --Line one - -Line two+Should be stripped-{T|zh:China;zh-tw:Taiwan}-! !! result --- !! end !! test -Bug 6200: paragraphs inside blockquotes (extra line break on close) +Testing that changing the language variant here in the tests actually works !! options -disabled +language=zh variant=zh showtitle !! input -Line one +Taiwan +
Should be stripped!
-Line twoLine one - -Line two -+Should be stripped-{T|zh:China;zh-tw:Taiwan}-! !! result -Line one -- !! end !! test -Bug 6200: paragraphs inside blockquotes (extra line break on open and close) +Bug 24072: more test on conversion rule for title !! options -disabled +language=zh variant=zh-tw showtitle !! input -Line two +China +
Should be stripped!
--Line one - -Line two -+This should be stripped-{T|zh:China;zh-tw:Taiwan}-! +This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-. !! result --- !! end !! test -Paragraphs inside blockquotes/divs (no extra line breaks) +Raw output of variant escape tags (R flag) +!! options +language=zh variant=zh-tw !! input -Line one -
Line two +Taiwan +
This should be stripped! +This won't take interferes with the title rule.
-+Raw: -{R|zh:China;zh-tw:Taiwan}- !! result -Line one - -Line two- +Line one -Line twoRaw: zh:China;zh-tw:Taiwan +
!! end !! test -Paragraphs inside blockquotes/divs (extra line break on open) +Nested using of manual convert syntax +!! options +language=zh variant=zh-hk !! input -+Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-! !! result --Line one - -Line two- !! end !! test -Paragraphs inside blockquotes/divs (extra line break on close) +Do not convert roman numbers to language variants +!! options +language=sr variant=sr-ec !! input --Line one +
Nested: Hello Hong Kong!
-Line two+Fridrih IV je car. !! result -Line one - -Line two -- !! end !! test -Paragraphs inside blockquotes/divs (extra line break on open and close) +Unclosed language converter markup "-{" +!! options +language=sr !! input -Line one -Line two +
ФÑидÑÐ¸Ñ IV Ñе ÑаÑ.
-+-{T|hello !! result --Line one - -Line two -- !! end !! test -Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion +Don't convert raw rule "-{R|=>}-" to "=>" !! options -wgLinkHolderBatchSize=0 +language=sr !! input -[[meatball:1]] -[[meatball:2]] -[[meatball:3]] -!! result --Line one -
Line two +
-{T|hello
-meatball:1 -meatball:2 -meatball:3 +-{R|=>}- +!! result +
=>
-!! end +!!end + +!!article +Template:Bullet +!!text +* Bar +!!endarticle !! test -Free external link invading image caption +Bug 529: Uncovered bullet !! input -[[Image:Foobar.jpg|thumb|http://x|hello]] +* Foo {{bullet}} !! result - +!! end !! test -Bug 15196: localised external link numbers -!! options -language=fa +Bug 529: Uncovered table already at line-start !! input -[http://en.wikipedia.org/] +x + +{{table}} +y !! result -
- Foo +
- Bar +
[Û±] +
x +
++
++ +1 +2 + + 3 +4 + y
!! end !! test -Multibyte character in padleft +Bug 529: Uncovered bullet in parser function result !! input -{{padleft:-Hello|7|Ã}} +* Foo {{lc:{{bullet}} }} !! result -Ã-Hello -
++ !! end !! test -Multibyte character in padright +Bug 5678: Double-parsed template argument !! input -{{padright:Hello-|7|Ã}} +{{lc:{{{1}}}|hello}} !! result -
- Foo +
- bar +
Hello-Ã +
{{{1}}}
!! end !! test -Formatted date -!! config -wgUseDynamicDates=1 +Bug 5678: Double-parsed template invocation !! input -[[2009-03-24]] +{{lc:{{paramtest {{!}} param = hello }} }} !! result -{{paramtest | param = hello }}
-!!end +!! end -!!test -formatdate parser function -!!input -{{#formatdate:2009-03-24}} +!! test +Case insensitivity of parser functions for non-ASCII characters (bug 8143) +!! options +language=cs +title=[[Main Page]] +!! input +{{PRVNÃVELKÃ:ÄÅ¡ÄÅ}} +{{prvnÃvelké:ÄÅ¡ÄÅ}} +{{PRVNÃMALÃ:ÄÅ¡ÄÅ}} +{{prvnÃmalé:ÄÅ¡ÄÅ}} +{{MALÃ:ÄÅ¡ÄÅ}} +{{malá:ÄÅ¡ÄÅ}} +{{VELKÃ:ÄÅ¡ÄÅ}} +{{velká:ÄÅ¡ÄÅ}} !! result -2009-03-24 +
ÄÅ¡ÄÅ +ÄÅ¡ÄÅ +ÄÅ¡ÄÅ +ÄÅ¡ÄÅ +ÄÅ¡ÄÅ +ÄÅ¡ÄÅ +ÄÅ ÄÅ +ÄÅ ÄÅ
!! end -!!test -formatdate parser function, with default format -!!input -{{#formatdate:2009-03-24|mdy}} +!! test +Morwen/13: Unclosed link followed by heading +!! input +[[link +==heading== !! result -March 24, 2009 +
[[link
+[edit] heading
+ !! end !! test -Linked date with autoformatting disabled -!! config -wgUseDynamicDates=false +HHP2.1: Heuristics for headings in preprocessor parenthetical structures !! input -[[2009-03-24]] +{{foo| +=heading= !! result -{{foo|
+heading
+ !! end !! test -Spacing of numbers in formatted dates +HHP2.2: Heuristics for headings in preprocessor parenthetical structures !! input -{{#formatdate:January 15}} +{{foo| +==heading== !! result -January 15 +
{{foo|
+[edit] heading
+ !! end !! test -Spacing of numbers in formatted dates (linked) -!! config -wgUseDynamicDates=true +Tildes in comments +!! options +pst !! input -[[January 15]] + !! result - + !! end -# -# -# - -# -# Edit comments -# - !! test -Edit comment with link -!! options -comment +Paragraphs inside divs (no extra line breaks) !! input -I like the [[Main Page]] a lot +Line one + +Line two!! result -I like the Main Page a lot -!!end +Line one +Line two+ +!! end !! test -Edit comment with link and link text -!! options -comment +Paragraphs inside divs (extra line break on open) !! input -I like the [[Main Page|best pages]] a lot ++Line one + +Line two!! result -I like the best pages a lot -!!end +++ +!! end !! test -Edit comment with link and link text with suffix -!! options -comment +Paragraphs inside divs (extra line break on close) !! input -I like the [[Main Page|best page]]s a lot +Line one +
+Line twoLine one + +Line two +!! result -I like the best pages a lot -!!end +Line one ++ +!! end !! test -Edit comment with section link (non-local, eg in history list) -!! options -comment title=[[Main Page]] +Paragraphs inside divs (extra line break on open and close) !! input -/* External links */ removed bogus entries +Line two +
++Line one + +Line two +!! result -ââExternal links: removed bogus entries -!!end +++ +!! end !! test -Edit comment with section link and text before it (non-local, eg in history list) +Nesting tags, paragraphs on lines which begin withLine one +
Line two +
+!! options -comment title=[[Main Page]] +disabled !! input -pre-comment text /* External links */ removed bogus entries +A +B !! result -pre-comment text - ââExternal links: removed bogus entries -!!end + +A +B +
+!! end +# Bug 6200:should behave likewith respect to line breaks !! test -Edit comment with section link (local, eg in diff view) +Bug 6200: paragraphs inside blockquotes (no extra line breaks) !! options -comment local title=[[Main Page]] +disabled !! input -/* External links */ removed bogus entries +Line one + +Line two!! result -ââExternal links: removed bogus entries -!!end +Line one +Line two+ +!! end !! test -Edit comment with subpage link (bug 14080) +Bug 6200: paragraphs inside blockquotes (extra line break on open) !! options -comment -subpage -title=[[Subpage test]] +disabled !! input -Poked at a [[/subpage]] here... ++Line one + +Line two!! result -Poked at a /subpage here... -!!end +++ +!! end !! test -Edit comment with subpage link and link text (bug 14080) +Bug 6200: paragraphs inside blockquotes (extra line break on close) !! options -comment -subpage -title=[[Subpage test]] +disabled !! input -Poked at a [[/subpage|neat little page]] here... +Line one +
+Line twoLine one + +Line two +!! result -Poked at a neat little page here... -!!end +Line one ++ +!! end !! test -Edit comment with bogus subpage link in non-subpage NS (bug 14080) +Bug 6200: paragraphs inside blockquotes (extra line break on open and close) !! options -comment -title=[[Subpage test]] +disabled !! input -Poked at a [[/subpage]] here... +Line two +
++Line one + +Line two +!! result -Poked at a /subpage here... -!!end +++ +!! end !! test -Edit comment with bare anchor link (local, as on diff) -!! options -comment -local -title=[[Main Page]] -!!input -[[#section]] +Paragraphs inside blockquotes/divs (no extra line breaks) +!! input +Line one +
Line two +
+!! result -#section +Line one + +Line two+ !! end !! test -Edit comment with bare anchor link (non-local, as on history) -!! options -comment -title=[[Main Page]] -!!input -[[#section]] +Paragraphs inside blockquotes/divs (extra line break on open) +!! input +Line one +Line two!! result -#section ++Line one + +Line two+ !! end !! test -Anchor starting with underscore -!!input -[[#_ref|One]] +Paragraphs inside blockquotes/divs (extra line break on close) +!! input ++Line one +
+Line two!! result -Line one + +Line two +One +
+ !! end !! test -Id starting with underscore -!!input - +Paragraphs inside blockquotes/divs (extra line break on open and close) +!! input +Line one +Line two
+!! result - ++Line one + +Line two +!! end !! test -Space normalisation on autocomment (bug 22784) +Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion !! options -comment -title=[[Main Page]] -!!input -/* __hello__world__ */ +wgLinkHolderBatchSize=0 +!! input +[[meatball:1]] +[[meatball:2]] +[[meatball:3]] !! result -ââ__hello__world__ ++Line one +
Line two +
+meatball:1 +meatball:2 +meatball:3 +
!! end !! test -percent-encoding and + signs in comments (Bug 26410) -!! options -comment -!!input -[[ABC%33D% ++]] [[ABC%33D% ++|+%20]] +Free external link invading image caption +!! input +[[Image:Foobar.jpg|thumb|http://x|hello]] !! result -ABC3D% ++ +%20 + + !! end !! test -Bad images - basic functionality +Bug 15196: localised external link numbers !! options -disabled +language=fa !! input -[[File:Bad.jpg]] +[http://en.wikipedia.org/] !! result +[Û±] +
!! end !! test -Bad images - bug 16039: text after bad image disappears -!! options -disabled +Multibyte character in padleft !! input -Foo bar -[[File:Bad.jpg]] -Bar foo +{{padleft:-Hello|7|Ã}} !! result -Foo bar -
Bar foo +
Ã-Hello
!! end !! test -Verify that displaytitle works (bug #22501) no displaytitle -!! options -showtitle -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false +Multibyte character in padright !! input -this is not the the title +{{padright:Hello-|7|Ã}} !! result -Parser test -this is not the the title +
Hello-Ã
!! end !! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false -!! options -showtitle -title=[[Screen]] +Formatted date !! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false +wgUseDynamicDates=1 !! input -this is not the the title -{{DISPLAYTITLE:whatever}} +[[2009-03-24]] !! result -whatever -this is not the the title +
+!!end + +!!test +formatdate parser function +!!input +{{#formatdate:2009-03-24}} +!! result +2009-03-24
!! end -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:whatever}} +!!test +formatdate parser function, with default format +!!input +{{#formatdate:2009-03-24|mdy}} !! result -Screen -this is not the the title +
March 24, 2009
!! end !! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching -!! options -showtitle -title=[[Screen]] +Linked date with autoformatting disabled !! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true +wgUseDynamicDates=false !! input -this is not the the title -{{DISPLAYTITLE:screen}} +[[2009-03-24]] !! result -screen -this is not the the title +
!! end !! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=false +Spacing of numbers in formatted dates !! input -this is not the the title -{{DISPLAYTITLE:screen}} +{{#formatdate:January 15}} !! result -Screen -this is not the the title -Template:DISPLAYTITLE:screen +
January 15
!! end !! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE -!! options -showtitle -title=[[Screen]] +Spacing of numbers in formatted dates (linked) !! config -wgAllowDisplayTitle=false +wgUseDynamicDates=true !! input -this is not the the title +[[January 15]] !! result -Screen -this is not the the title +
!! end - + +# +# +# + +# +# Edit comments +# + !! test -preload: checkand +Edit comment with link !! options -preload +comment !! input -Hello cruel kind world. +I like the [[Main Page]] a lot !! result -Hello kind world. -!! end - +I like the Main Page a lot +!!end + !! test -preload: check+Edit comment with link and link text !! options -preload +comment !! input -Goodbye Hello world +I like the [[Main Page|best pages]] a lot !! result -Hello world -!! end +I like the best pages a lot +!!end !! test -preload: can pass tags through if we want to +Edit comment with link and link text with suffix !! options -preload +comment !! input -< includeonly>Hello world< /includeonly> +I like the [[Main Page|best page]]s a lot !! result -Hello world -!! end +I like the best pages a lot +!!end !! test -preload: check that it doesn't try to do tricks +Edit comment with section link (non-local, eg in history list) !! options -preload +comment title=[[Main Page]] !! input -* ''{{world}}'' {{subst: How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} +/* External links */ removed bogus entries !! result -* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! end +ââExternal links: removed bogus entries +!!end !! test -Play a bit with r67090 and bug 3158 +Edit comment with section link and text before it (non-local, eg in history list) !! options -disabled +comment title=[[Main Page]] !! input ----+pre-comment text /* External links */ removed bogus entries !! result ----- -!! end +pre-comment text - ââExternal links: removed bogus entries +!!end !! test -HTML5 data attributes +Edit comment with section link (local, eg in diff view) +!! options +comment local title=[[Main Page]] !! input -Baz -Quuz
+/* External links */ removed bogus entries !! result -Baz -
-Quuz
- -!! end +ââExternal links: removed bogus entries +!!end !! test -percent-encoding and + signs in internal links (Bug 26410) -!! input -[[User:+%]] [[Page+title%]] -[[%+]] [[%+|%20]] [[%+ ]] [[%+r]] -[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] -[[%33%45]] [[%33%45+]] -!! result -User:+% Page+title% -%+ %20 %+ %+r -% + bar -3E 3E+ -
-!! end +Edit comment with subpage link (bug 14080) +!! options +comment +subpage +title=[[Subpage test]] +!! input +Poked at a [[/subpage]] here... +!! result +Poked at a /subpage here... +!!end !! test -Special characters in embedded file links (bug 27679) +Edit comment with subpage link and link text (bug 14080) +!! options +comment +subpage +title=[[Subpage test]] !! input -[[File:Contains & ampersand.jpg]] -[[File:Does not exist.jpg|Title with & ampersand]] +Poked at a [[/subpage|neat little page]] here... !! result -File:Contains & ampersand.jpg -Title with & ampersand -
-!! end - +Poked at a neat little page here... +!!end !! test -Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) +Edit comment with bogus subpage link in non-subpage NS (bug 14080) +!! options +comment +title=[[Subpage test]] !! input -Text's been normalized? +Poked at a [[/subpage]] here... !! result -Text's been normalized? -
-!! end +Poked at a /subpage here... +!!end !! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links -!! input -http://www.example.org/ã<-- U+3000 (vim: ^Vu3000) +Edit comment with bare anchor link (local, as on diff) +!! options +comment +local +title=[[Main Page]] +!!input +[[#section]] !! result -http://www.example.org/ã<-- U+3000 (vim: ^Vu3000) -
+#section !! end !! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links -!! input -[http://www.example.org/ãideograms] +Edit comment with bare anchor link (non-local, as on history) +!! options +comment +title=[[Main Page]] +!!input +[[#section]] !! result - +#section !! end !! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links -!! input -http://www.example.org/pic.pngã<-- U+3000 (vim: ^Vu3000) +Anchor starting with underscore +!!input +[[#_ref|One]] !! result -!! end -!! article -Mediawiki:loop1 -!! text -{{Identical|A}} -!! endarticle - -!! article -Mediawiki:loop2 -!! text -{{Identical|B}} -!! endarticle - -!! article -Template:Identical -!! text -{{int:loop1}} -{{int:loop2}} -!! endarticle - !! test -Bug 31098 Template which includes system messages which includes the template -!! input -{{Identical}} +Id starting with underscore +!!input + !! result -
ã<-- U+3000 (vim: ^Vu3000) +
Template loop detected: Template:Identical -Template loop detected: Template:Identical -
+ + !! end !! test -Deprecated presentational attributes are converted to css -!! input -{| -| valign=top align=left width=100 height=25% | Asdf -|} -+Space normalisation on autocomment (bug 22784) +!! options +comment +title=[[Main Page]] +!!input +/* __hello__world__ */ !! result -
-
-- Asdf - - +ââ__hello__world__ !! end !! test -Bug31490 Turkish: ucfirst 'blah' +percent-encoding and + signs in comments (Bug 26410) !! options -language=tr -!! input -{{ucfirst:blah}} +comment +!!input +[[ABC%33D% ++]] [[ABC%33D% ++|+%20]] !! result -
Blah -
+ABC3D% ++ +%20 !! end !! test -Bug31490 Turkish: ucfirst 'ix' +Bad images - basic functionality !! options -language=tr +disabled !! input -{{ucfirst:ix}} +[[File:Bad.jpg]] !! result -Ä°x -
!! end !! test -Bug31490 Turkish: lcfirst 'BLAH' +Bad images - bug 16039: text after bad image disappears !! options -language=tr +disabled !! input -{{lcfirst:BLAH}} +Foo bar +[[File:Bad.jpg]] +Bar foo !! result -bLAH +
Foo bar +
Bar foo
!! end !! test -Bug31490 Turkish: ucfırst (with a dotless i) +Verify that displaytitle works (bug #22501) no displaytitle !! options -language=tr +showtitle +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=false !! input -{{ucfırst:blah}} +this is not the the title !! result -Åablon:Ucfırst:blah +Parser test +
this is not the the title
!! end !! test -Bug31490 ucfırst (with a dotless i) with English language +Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false !! options -language=en +showtitle +title=[[Screen]] +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=false !! input -{{ucfırst:blah}} +this is not the the title +{{DISPLAYTITLE:whatever}} !! result -Template:Ucfırst:blah +whatever +
this is not the the title
!! end !! test -Bug 26375: TOC with italics +Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch !! options -title=[[Main Page]] +showtitle +title=[[Screen]] +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=true !! input -__TOC__ -== ''Lost'' episodes == +this is not the the title +{{DISPLAYTITLE:whatever}} !! result --
- -Contents
[edit] Lost episodes
- +Screen +this is not the the title +
!! end !! test -Bug 26375: TOC with bold +Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching !! options -title=[[Main Page]] +showtitle +title=[[Screen]] +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=true !! input -__TOC__ -== '''should be bold''' then normal text == +this is not the the title +{{DISPLAYTITLE:screen}} !! result --
- -Contents
[edit] should be bold then normal text
- +screen +this is not the the title +
!! end !! test -Bug 33845: Headings become cursive in TOC when they contain an image +Verify that displaytitle works (bug #22501) AllowDisplayTitle=false !! options -title=[[Main Page]] +showtitle +title=[[Screen]] +!! config +wgAllowDisplayTitle=false !! input -__TOC__ -== Image [[Image:foobar.jpg]] == +this is not the the title +{{DISPLAYTITLE:screen}} !! result --
-Contents
-
-- 1 Image
-[edit] Image
- +Screen +![]()
this is not the the title +Template:DISPLAYTITLE:screen +
!! end !! test -Bug 33845 (2): Headings become bold in TOC when they contain a blockquote +Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE !! options -title=[[Main Page]] +showtitle +title=[[Screen]] +!! config +wgAllowDisplayTitle=false !! input -__TOC__ -==Quote== -!! result --
-Contents
-
-- 1 Quote
-[edit]
- +this is not the the title +!! result +Screen +Quotethis is not the the title +
!! end - + !! test -Unclosed tags in TOC +preload: checkand !! options -title=[[Main Page]] +preload !! input -__TOC__ -== Proof: 2 < 3 == -Hanc marginis exiguitas non caperet. -QED +Hello cruel kind world. !! result --
- -Contents
[edit] Proof: 2 < 3
-Hanc marginis exiguitas non caperet. -QED -
+Hello kind world. !! end - + !! test -Multiple tags in TOC +preload: check+!! options +preload !! input -__TOC__ -== Foo Bar == - -== Foo Bar== +GoodbyeHello world !! result --
- -Contents
[edit] Foo Bar
-[edit] Foo
- +Hello world !! end !! test -Tags with parameters in TOC +preload: can pass tags through if we want to +!! options +preload !! input -__TOC__ -== Hello == - -== Evilbye == +Bar< includeonly>Hello world< /includeonly> !! result --
-Contents
-
-- 1 Hello
-- 2 b">Evilbye
-[edit] Hello
-[edit] b">Evilbye
- +Hello world !! end -!! article -MediaWiki:Bug32057 -!! text -== {{int:headline_sample}} == -!! endarticle - !! test -Bug 32057: Title needed when expandingnodes. +preload: check that it doesn't try to do tricks !! options -title=[[Main Page]] +preload !! input -{{int:Bug32057}} +* ''{{world}}'' {{ subst: How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} !! result -[edit] Headline text
- +* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} !! end !! test -Strip marker in urlencode +Play a bit with r67090 and bug 3158 +!! options +disabled !! input -{{urlencode:xy}} -{{urlencode:x y|wiki}} -{{urlencode:x y|path}} + +++!! result -xy -xy -xy -
+++++ !! end !! test -Strip marker in lc +HTML5 data attributes !! input -{{lc:xy}} +Baz + Quuz
!! result -xy +
Baz
+Quuz
+ !! end !! test -Strip marker in uc +percent-encoding and + signs in internal links (Bug 26410) !! input -{{uc:xy}} +[[User:+%]] [[Page+title%]] +[[%+]] [[%+|%20]] [[%+ ]] [[%+r]] +[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] +[[%33%45]] [[%33%45+]] !! result - XY +
User:+% Page+title% +%+ %20 %+ %+r +% + bar +3E 3E+
!! end !! test -Strip marker in formatNum +Special characters in embedded file links (bug 27679) !! input -{{formatnum:12}} -{{formatnum:1 2|R}} +[[File:Contains & ampersand.jpg]] +[[File:Does not exist.jpg|Title with & ampersand]] !! result - 12 -12 +
File:Contains & ampersand.jpg +Title with & ampersand
!! end + !! test -Strip marker in grammar -!! options -language=fi +Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) !! input -{{grammar:elative|foobar}} +Text's been normalized? !! result - foobarista +
Text's been normalized?
!! end !! test -Strip marker in padleft +Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links !! input -{{padleft:|2|xy}} +http://www.example.org/ã<-- U+3000 (vim: ^Vu3000) !! result - xy +
http://www.example.org/ã<-- U+3000 (vim: ^Vu3000)
!! end !! test -Strip marker in padright +Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links !! input -{{padright:|2|xy}} +[http://www.example.org/ãideograms] !! result - xy +
!! end !! test -Strip marker in anchorencode +Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links !! input -{{anchorencode:xy}} +http://www.example.org/pic.pngã<-- U+3000 (vim: ^Vu3000) !! result - xy +
!! end -!! test -nowiki inside link inside heading (bug 18295) -!! input -==[[foo|x
ã<-- U+3000 (vim: ^Vu3000)
y z]]== -!! result -[edit] xyz
+!! article +Mediawiki:loop1 +!! text +{{Identical|A}} +!! endarticle -!! end +!! article +Mediawiki:loop2 +!! text +{{Identical|B}} +!! endarticle + +!! article +Template:Identical +!! text +{{int:loop1}} +{{int:loop2}} +!! endarticle !! test -new support for bdi element (bug 31817) +Bug 31098 Template which includes system messages which includes the template !! input -××××××ר ×× ×× (×ר×ס×ת: ÐÐ»Ð°Ð´Ð¸Ð¼Ð¸Ñ Ðенин, 24 ××פר×× 1870â22 ××× ××ר 1924) ××× ×× ××× ×¤××××× ×§×××× ×ס×× ×¨×ס×.
+{{Identical}} !! result -××××××ר ×× ×× (×ר×ס×ת: ÐÐ»Ð°Ð´Ð¸Ð¼Ð¸Ñ Ðенин, 24 ××פר×× 1870â22 ××× ××ר 1924) ××× ×× ××× ×¤××××× ×§×××× ×ס×× ×¨×ס×.
- -!!end +Template loop detected: Template:Identical +Template loop detected: Template:Identical +
+!! end !! test -Ignore pipe between table row attributes +Deprecated presentational attributes are converted to css !! input {| -| quux -|- id=foo | style='color: red' -| bar +| valign=top align=left width=100 height=25% | Asdf |} +!! result
+
- -quux - - bar + Asdf !! end -!!test -Gallery override link with WikiLink (bug 34852) +!! test +Bug31490 Turkish: ucfirst 'blah' +!! options +language=tr !! input -
-File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink - +{{ucfirst:blah}} !! result --
- !! end -!!test -Gallery override link with absolute external link (bug 34852) +!! test +Bug31490 Turkish: ucfirst 'ix' +!! options +language=tr !! input -- -
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org - +{{ucfirst:ix}} !! result --
- !! end -!!test -Gallery override link with malicious javascript (bug 34852) +!! test +Bug31490 Turkish: lcfirst 'BLAH' +!! options +language=tr !! input -- -
-File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); - +{{lcfirst:BLAH}} !! result --
- !! end -!!test -Language parser function +!! test +Bug31490 Turkish: ucfırst (with a dotless i) +!! options +language=tr !! input -{{#language:ar}} +{{ucfırst:blah}} !! result -- -
اÙعربÙØ© +
!! end -!!test -Padleft and padright as substr +!! test +Bug31490 ucfırst (with a dotless i) with English language +!! options +language=en !! input -{{padleft:|3|abcde}} -{{padright:|3|abcde}} +{{ucfırst:blah}} !! result -abc -abc +
!! end !! test -Definition Lists: No nesting: Multiple dd's +Bug 26375: TOC with italics +!! options +title=[[Main Page]] !! input -;x -:a -:b +__TOC__ +== ''Lost'' episodes == !! result -+
- x -
- a -
- b -
+
+ +Contents
[edit] Lost episodes
!! end !! test -Definition Lists: Indentation: Regular +Bug 26375: TOC with bold +!! options +title=[[Main Page]] !! input -:i1 -::i2 -:::i3 +__TOC__ +== '''should be bold''' then normal text == !! result -+
- i1 -
-
- i2 -
-
- i3 -
+
+ +Contents
[edit] should be bold then normal text
!! end !! test -Definition Lists: Indentation: Missing 1st level +Bug 33845: Headings become cursive in TOC when they contain an image +!! options +title=[[Main Page]] !! input -::i2 -:::i3 +__TOC__ +== Image [[Image:foobar.jpg]] == !! result -+
-
- i2 -
-
- i3 -
+
+Contents
+
+- 1 Image
+[edit] Image
!! end !! test -Definition Lists: Indentation: Multi-level indent +Bug 33845 (2): Headings become bold in TOC when they contain a blockquote +!! options +title=[[Main Page]] !! input -:::i3 +__TOC__ +==
Quote== !! result -+
-
-
- i3 -
+
+Contents
+
+- 1 Quote
+[edit]
!! 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: -## -##Quote-##
-## -## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text -## So, the same wikitext above (;;t2 ::d2) is transformed into: -## -##- t2
-##- -##
-##-## -##
-##- d2
-##-##
-## -## All Parsoid only definition list tests have this difference. - !! test -Definition Lists: Nesting: Multi-level (Parsoid only) +Unclosed tags in TOC !! options -disabled +title=[[Main Page]] !! input -;t1 :d1 -;;t2 ::d2 -;;;t3 :::d3 +__TOC__ +== Proof: 2 < 3 == +Hanc marginis exiguitas non caperet. +QED !! result -- -##
-##
-## -##- t2
-##- :d2
-##-
+- t1
-- d1
-- -
-
- -- t2
-- :d2
-- -
-
- -- t3
-- ::d3
-+
+ +Contents
[edit] Proof: 2 < 3
+Hanc marginis exiguitas non caperet. +QED +
+!! end +!! test +Multiple tags in TOC +!! input +__TOC__ +== Foo Bar == -!! end +== FooBar== +!! result ++
+ +Contents
[edit] Foo Bar
+[edit] Foo
+!! end !! test -Definition Lists: Nesting: Test 2 (Parsoid only) -!! options -disabled +Tags with parameters in TOC !! input -;t1 -::d2 +__TOC__ +== Hello == + +== Evilbye == !! result -Bar-
+- t1
-- -
--
-- d2
-+
+Contents
+
+- 1 Hello
+- 2 b">Evilbye
+[edit] Hello
+[edit] b">Evilbye
!! end +!! article +MediaWiki:Bug32057 +!! text +== {{int:headline_sample}} == +!! endarticle !! test -Definition Lists: Nesting: Test 3 (Parsoid only) +Bug 32057: Title needed when expandingnodes. !! options -disabled +title=[[Main Page]] !! input -:;t1 -::::d2 +{{int:Bug32057}} !! result - -
+- -
--
-- t1
-- -
--
-- -
--
-- d2
-[edit] Headline text
+ +!! end +!! test +Strip marker in urlencode +!! input +{{urlencode:xy}} +{{urlencode:x y|wiki}} +{{urlencode:x y|path}} +!! result + xy +xy +xy +
!! end - !! test -Definition Lists: Nesting: Test 4 +Strip marker in lc !! input -::;t3 -:::d3 +{{lc:xy}} !! result - - +
-
-
- t3 -
- d3 -
xy +
!! end - !! test -Definition Lists: Mixed Lists: Test 1 +Strip marker in uc !! input -:;* foo -::* bar -:; baz +{{uc:xy}} !! result - - +
-
-
- foo -
- bar -
-
- baz -
XY +
!! end - !! test -Definition Lists: Mixed Lists: Test 2 +Strip marker in formatNum !! input -*: d1 -*: d2 +{{formatnum:12}} +{{formatnum:1 2|R}} !! result - - +
-
- d1 -
- d2 -
12 +12 +
!! end - !! test -Definition Lists: Mixed Lists: Test 3 +Strip marker in grammar +!! options +language=fi !! input -*::: d1 -*::: d2 +{{grammar:elative|foobar}} !! result - - +
-
-
-
- d1 -
- d2 -
foobarista +
!! end - !! test -Definition Lists: Mixed Lists: Test 4 +Strip marker in padleft !! input -*;d1 :d2 -*;d3 :d4 +{{padleft:|2|xy}} !! result - - +
-
- d1
- d2 -
- d3
- d4 -
xy +
!! end - !! test -Definition Lists: Mixed Lists: Test 5 +Strip marker in padright !! input -*:d1 -*:: d2 +{{padright:|2|xy}} !! result - - +
-
- d1 -
-
- d2 -
xy +
!! end - !! test -Definition Lists: Mixed Lists: Test 6 +Strip marker in anchorencode !! input -#*:d1 -#*::: d3 +{{anchorencode:xy}} !! result - - +
-
-
- d1 -
-
-
- d3 -
xy +
!! end - !! test -Definition Lists: Mixed Lists: Test 7 +nowiki inside link inside heading (bug 18295) !! input -:* d1 -:* d2 +==[[foo|xy z]]== !! result -+
-
- d1 -
- d2 -
[edit] xyz
!! end - !! test -Definition Lists: Mixed Lists: Test 8 +new support for bdi element (bug 31817) !! input -:* d1 -::* d2 +××××××ר ×× ×× (×ר×ס×ת: ÐÐ»Ð°Ð´Ð¸Ð¼Ð¸Ñ Ðенин, 24 ××פר×× 1870â22 ××× ××ר 1924) ××× ×× ××× ×¤××××× ×§×××× ×ס×× ×¨×ס×.
!! result -- -!! end +
-
- d1 -
-
-
- d2 -
××××××ר ×× ×× (×ר×ס×ת: ÐÐ»Ð°Ð´Ð¸Ð¼Ð¸Ñ Ðенин, 24 ××פר×× 1870â22 ××× ××ר 1924) ××× ×× ××× ×¤××××× ×§×××× ×ס×× ×¨×ס×.
+!!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 -+
-
- foo
- bar -
+
!! end - -!! test -Definition Lists: Mixed Lists: Test 10 +!!test +Gallery override link with WikiLink (bug 34852) !! input -*#;foo :bar ++ +quux + + bar + +File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink + !! result -+
-
-
- foo
- bar -
+
!! end - -!! test -Definition Lists: Mixed Lists: Test 11 +!!test +Gallery override link with absolute external link (bug 34852) !! input -*#*#;*;;foo :bar -*#*#;boo :baz +- +
+File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org + !! result -- - +
-
- -
-
- foo
-
- bar -
-
- boo
- baz -
+
!! end +!!test +Gallery override link with malicious javascript (bug 34852) +!! input +- +
+File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); + +!! result ++
+ +!! end -!! test -Definition Lists: Weird Ones: Test 1 +!!test +Language parser function !! input -*#;*::;; foo : bar (who uses this?) +{{#language:ar}} !! result -- +
- - - +
-
- foo
-
-
-
- bar (who uses this?) -
اÙعربÙØ© +
+!! end +!!test +Padleft and padright as substr +!! input +{{padleft:|3|abcde}} +{{padright:|3|abcde}} +!! result +abc +abc +
!! end + TODO: more images more tables