X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=22970a147d9ffbeee2c3b1fa5215afa233029e8b;hb=42a1d6bf0312cf73ed9c90c1c788b9027665d18a;hp=706d33b1f3d7634d40cdf97c81cf03b589f043ff;hpb=a90aab9ee2b0c8de87e03b4f9f8718d07d227c36;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 706d33b1f3..22970a147d 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -615,6 +615,26 @@ disabled !! end +!! test +Definition and unordered list using wiki syntax nested in unordered list using html tags. +!! input + +!! result + + +!! end + + ### ### External links ### @@ -714,6 +734,42 @@ second]

!!end +!! test +External links: protocol-relative URL in brackets +!! input +[//example.com/ Test] +!! result +

Test +

+!! end + +!! test +External links: protocol-relative URL in brackets without text +!! input +[//example.com] +!! result +

[1] +

+!! end + +!! test +External links: protocol-relative URL in free text is left alone +!! input +//example.com/Foo +!! result +

//example.com/Foo +

+!!end + +!! test +External links: protocol-relative URL in the middle of a word is left alone (bug 30269) +!! input +foo//example.com/Foo +!! result +

foo//example.com/Foo +

+!! end + !! test External image !! input @@ -975,33 +1031,6 @@ External links: wiki links within external link (Bug 3695)

!! end -!! test -External links: links containing empty bracket pair [] -!! input -[http://example.com?parameter[]=foo link] -!! result -

link -

-!! end - -!! test -External links: links ending in empty bracket pair [] -!! input -[http://example.com?parameter[]=foo&option[]] -!! result -

[1] -

-!! end - -!! test -External links: bare links ending in empty bracket pair [] -!! input -http://example.com?parameter[]=foo&option[] -!! result -

http://example.com?parameter%5B%5D=foo&option%5B%5D -

-!! end - !! test BUG 787: Links with one slash after the url protocol are invalid !! input @@ -1041,8 +1070,10 @@ http://www.example.com/?title=AT%26T

!! end +# According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain +# % is actually legal in HTML5. Any change in output would need testing though. !! test -Bug 4781, 5267: %26 in URL +Bug 4781, 5267: %25 in URL !! input http://www.example.com/?title=100%25_Bran !! result @@ -1160,6 +1191,29 @@ URL-encoding in URL functions (multiple parameters)

!! end +!! test +Brackets in urls +!! input +http://example.com/index.php?foozoid%5B%5D=bar + +http://example.com/index.php?foozoid[]=bar +!! result +

http://example.com/index.php?foozoid%5B%5D=bar +

http://example.com/index.php?foozoid%5B%5D=bar +

+!! end + +!! test +IPv6 urls (bug 21261) +!! options +disabled +!! input +http://[2404:130:0:1000::187:2]/index.php +!! result +

http://[2404:130:0:1000::187:2]/index.php +

+!! end + ### ### Quotes ### @@ -1237,10 +1291,8 @@ A table with nothing but a caption |} !! result - - -
caption -
+ caption + !! end @@ -1255,14 +1307,13 @@ Simple table !! result - - - + + - - - -
12
1 2 +
34
+ 3 + 4 + !! end @@ -1293,52 +1344,54 @@ Multiplication table - - - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - -
Multiplication table
×123
× 1 2 3 +
1123
1 + 1 2 3 +
2246
2 + 2 4 6 +
3369
3 + 3 6 9 +
44812
4 + 4 8 12 +
551015
+ 5 + + 5 + 10 + 15 + !! end !! test Table rowspan !! input -{| align=right border=1 +{| border=1 | Cell 1, row 1 |rowspan=2| Cell 2, row 1 (and 2) | Cell 3, row 1 @@ -1347,17 +1400,19 @@ Table rowspan | Cell 3, row 2 |} !! result - +
- - - - + + + - - - -
Cell 1, row 1Cell 2, row 1 (and 2)Cell 3, row 1
Cell 1, row 1 + Cell 2, row 1 (and 2) + Cell 3, row 1 +
Cell 1, row 2Cell 3, row 2
+ Cell 1, row 2 + + Cell 3, row 2 + !! end @@ -1377,19 +1432,19 @@ Nested table !! result - + - - -
α α + - - + - - -
nested
nested +
table
the original table again
+table + + +the original table again + !! end @@ -1402,81 +1457,11 @@ Invalid attributes in table cell (bug 1830) !! result - - -
broken
- -!! end - -!! test -Heading inside table (affected by r85922) -!! input -{| -|- valign="top" -| -=== Heading === -|} -!! result - - - - -
-

[edit] Heading

-
- -!! end - -!! test -A table with a caption with unclosed italic -!! input -{| -|+ ''caption -| Cell -|} -!! result - - - - - -
caption -
Cell
- -!! end - -!! test -A table with unclosed italic in a cell -!! input -{| -| ''Cell -|} -!! result - - - - -
Cell
+broken + !! end -!! test -A table with unclosed italic in a th -!! input -{| -|- -! ''Cell -|| Value -|} -!! result - - - - - -
CellValue
- -!! end !! test Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) @@ -1487,33 +1472,37 @@ Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitec - +
[ftp://%7Cx]" onmouseover="alert(document.cookie)">test]" onmouseover="alert(document.cookie)">test +
!! end + !! test -Indented Tables, bug 20078 +Indented table markup mixed with indented pre content (proposed in bug 6200) !! input -: {| -| 1 || 2 -|- -| 3 || 4 -|} + + + + +
+ Text that should be rendered preformatted +
!! result -
- - - - - - - - -
12
34
+ + + + +
+
Text that should be rendered preformatted
+
+
!! end + + ### ### Internal links ### @@ -1522,7 +1511,7 @@ Plain link, capitalized !! input [[Main Page]] !! result -

Main Page +

Main Page

!! end @@ -1531,7 +1520,7 @@ Plain link, uncapitalized !! input [[main Page]] !! result -

main Page +

main Page

!! end @@ -1585,7 +1574,7 @@ Link with prefix !! input xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]] !! result -

xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page +

xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page

!! end @@ -1594,7 +1583,7 @@ Link with suffix !! input [[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!! !! result -

Main Pagexxx, Main PageXXX, Main Page!!! +

Main Pagexxx, Main PageXXX, Main Page!!!

!! end @@ -1752,6 +1741,34 @@ Plain link to URL

!! end +!! test +Plain link to URL with link text +!! input +[[http://www.example.com Link text]] +!! result +

[Link text] +

+!! end + +!! test +Plain link to protocol-relative URL +!! input +[[//www.example.com]] +!! result +

[[1]] +

+!! end + +!! test +Plain link to protocol-relative URL with link text +!! input +[[//www.example.com Link text]] +!! result +

[Link text] +

+!! 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.... # However the current output is also pretty screwy. @@ -1827,7 +1844,7 @@ title=[[0]] !!input [[00]] !!result -

00 +

00

!!end @@ -1856,7 +1873,7 @@ language=ca !! input '''[[Main Page]]''' !! result -

Main Page +

Main Page

!! end @@ -1867,7 +1884,7 @@ language=ca !! input ''[[Main Page]]'' !! result -

Main Page +

Main Page

!! end @@ -1913,7 +1930,7 @@ Inline interwiki link !! input [[MeatBall:SoftSecurity]] !! result -

MeatBall:SoftSecurity +

MeatBall:SoftSecurity

!! end @@ -1922,7 +1939,7 @@ Inline interwiki link with empty title (bug 2372) !! input [[MeatBall:]] !! result -

MeatBall: +

MeatBall:

!! end @@ -2019,13 +2036,13 @@ Incorrecly removing closing slashes from correctly formed XHTML !! test Failing to transform badly formed HTML into correct XHTML !! input -
-
-
+
+
+
!! result -


-
-
+


+
+

!!end @@ -2529,7 +2546,7 @@ Magic links: RFC (bug 479) !! input RFC 822 !! result -

RFC 822 +

RFC 822

!! end @@ -2547,7 +2564,7 @@ Magic links: PMID incorrectly converts space to underscore !! input PMID 1234 !! result -

PMID 1234 +

PMID 1234

!! end @@ -2773,9 +2790,8 @@ BUG 553: link with two variables in a piped link !! result - - -
[[{{{1}}}|{{{2}}}]]
+[[{{{1}}}|{{{2}}}]] + !! end @@ -2830,7 +2846,7 @@ Template as link source !! input [[{{linktest2}}]] !! result -

Main Page +

Main Page

!! end @@ -2852,7 +2868,7 @@ Template infinite loop !! input {{loop1}} !! result -

Template loop detected: Template:Loop1 +

Template loop detected: Template:Loop1

!! end @@ -2884,14 +2900,13 @@ foo {{table}}

- - - + + - - - -
12
1 2 +
34
+ 3 + 4 + !! end @@ -2905,14 +2920,13 @@ foo

- - - + + - - - -
12
1 2 +
34
+ 3 + 4 + !! end @@ -3444,6 +3458,140 @@ pst title=[[Ns:Somearticle (IGNORED), Context]] [[Ns:Article, Context|Article]] !! end +!! test +pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149) +!! options +pst +!! input +[[Article(context)|]] +[[Bar:Article(context)|]] +[[:Bar:Article(context)|]] +[[|Article(context)]] +[[Bar:X (Y) Z|]] +[[:Bar:X (Y) Z|]] +!! result +[[Article(context)|Article]] +[[Bar:Article(context)|Article]] +[[:Bar:Article(context)|Article]] +[[Article(context)]] +[[Bar:X (Y) Z|X (Y) Z]] +[[:Bar:X (Y) Z|X (Y) Z]] +!! end + +!! test +pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149) +!! options +pst +!! input +[[Article (context)|]] +[[Bar:Article (context)|]] +[[:Bar:Article (context)|]] +[[|Article (context)]] +[[Bar:X (Y) Z|]] +[[:Bar:X (Y) Z|]] +!! result +[[Article (context)|Article]] +[[Bar:Article (context)|Article]] +[[:Bar:Article (context)|Article]] +[[Article (context)]] +[[Bar:X (Y) Z|X (Y) Z]] +[[:Bar:X (Y) Z|X (Y) Z]] +!! end + +!! test +pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149) +!! options +pst +!! input +[[Article(context)|]] +[[Bar:Article(context)|]] +[[:Bar:Article(context)|]] +[[|Article(context)]] +[[Bar:X(Y)Z|]] +[[:Bar:X(Y)Z|]] +!! result +[[Article(context)|Article]] +[[Bar:Article(context)|Article]] +[[:Bar:Article(context)|Article]] +[[Article(context)]] +[[Bar:X(Y)Z|X(Y)Z]] +[[:Bar:X(Y)Z|X(Y)Z]] +!! end + +!! test +pre-save transform: trim trailing empty lines +!! options +pst +!! input +Empty lines are trimmed + + + + +!! result +Empty lines are trimmed +!! end + +!! test +pre-save transform: Signature expansion +!! options +pst +!! input +* ~~~ +* ~~~ +* ~~~ +* ~~~ +!! result +* [[Special:Contributions/127.0.0.1|127.0.0.1]] +* [[Special:Contributions/127.0.0.1|127.0.0.1]] +* [[Special:Contributions/127.0.0.1|127.0.0.1]] +* [[Special:Contributions/127.0.0.1|127.0.0.1]] +!! end + + +!! test +pre-save transform: Signature expansion in nowiki tags (bug 93) +!! options +pst disabled +!! input +Shall not expand: + +~~~~ + +~~~~ + +~~~~ + +~~~~ + +{{subst:Foo}} shall be converted to FOO + +As well as inside noinclude/onlyinclude +{{subst:Foo}} +{{subst:Foo}} + +But not inside includeonly +{{subst:Foo}} +!! result +Shall not expand: + +~~~~ + +~~~~ + +~~~~ + +~~~~ + +FOO shall be converted to FOO + +As well as inside noinclude/onlyinclude +FOO +FOO + +But not inside includeonly +{{subst:Foo}} +!! end ### ### Message transform tests @@ -3638,7 +3786,7 @@ Image with frame and link !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] !! result -
This is a test image Main Page
+
This is a test image Main Page
!! end @@ -3647,7 +3795,7 @@ Image with frame and link and explicit alt !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] !! result -
Altitude
This is a test image Main Page
+
Altitude
This is a test image Main Page
!! end @@ -3730,7 +3878,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
+
This is RFC 12354
!! end @@ -3847,7 +3995,7 @@ Redirected image !! input [[Image:Barfoo.jpg]] !! result -

File:Barfoo.jpg +

File:Barfoo.jpg

!! end @@ -3858,7 +4006,7 @@ wgEnableUploads=0 !! input [[Image:Foobaz.jpg]] !! result -

File:Foobaz.jpg +

File:Foobaz.jpg

!! end @@ -3928,7 +4076,7 @@ Link to category !! input [[:Category:MediaWiki User's Guide]] !! result -

Category:MediaWiki User's Guide +

Category:MediaWiki User's Guide

!! end @@ -4437,9 +4585,9 @@ div with unquoted attribute !! test div with illegal double attributes !! input -
HTML rocks
+
HTML rocks
!! result -
HTML rocks
+
HTML rocks
!!end @@ -4461,18 +4609,17 @@ Table multiple attributes correction !! result - - -
status
+ status + !!end !! test DIV IN UPPERCASE !! input -
HTML ROCKS
+
HTML ROCKS
!! result -
HTML ROCKS
+
HTML ROCKS
!!end @@ -4597,7 +4744,7 @@ The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E אַ אÖ· אַ -אַ +אַ

!! end @@ -4660,7 +4807,7 @@ Bug 2095: link with three closing brackets !! input [[Main Page]]] !! result -

Main Page] +

Main Page]

!! end @@ -4907,9 +5054,8 @@ Table attribute legitimate extension !! result - - -
status
+ status + !!end @@ -4922,9 +5068,8 @@ Table attribute safety !! result - - -
status
+ status + !! end @@ -5274,6 +5419,26 @@ disabled Something need to be done. foo-2 ? !! end +!! test +Sanitizer: Validating that and work, but only for Microdata +!! input +
+ + + + +
+!! result +
+

+ <meta http-equiv="refresh" content="5"> +

+ + <link rel="stylesheet" href="http://Britney-Spears"> +
+ +!! end + !! test Language converter: output gets cut off unexpectedly (bug 5757) !! options @@ -5546,7 +5711,8 @@ Fuzz testing: Parser13 !! result - +
+
@@ -5572,13 +5738,10 @@ Fuzz testing: Parser14-table !! input ==a== {| STYLE=__TOC__ -|foo !! result

[edit] a

- - - +
foo
!! end @@ -5597,7 +5760,8 @@ noxml https:// - + + @@ -5612,8 +5776,10 @@ Fuzz testing: Parser21 !! result - - + +
irc://{{ftp://a" onmouseover="alert('hello world');" irc://{{ftp://a" onmouseover="alert('hello world');" + +
@@ -5625,30 +5791,15 @@ Fuzz testing: Parser22 http://===r:::https://b {| - !!result

http://===r:::https://b

+ + +
!! end -# Known to produce bad XML for now - -# Note: the current result listed for this is not what the original one was, -# but the original bug was JavaScript injection, which is fixed in any case. -# It's not clear that the original result listed was any more correct than the -# current one. Original result: -# -# {{{| -# }}}} > -#
-# -# MOVE YOUR MOUSE CURSOR OVER THIS TEXT -#
-# -# -#
-#
# Known to produce bad XML for now !! test Fuzz testing: Parser24 @@ -5664,15 +5815,15 @@ noxml MOVE YOUR MOUSE CURSOR OVER THIS TEXT | !! result -

{{{| -

}}}} > -


-


-MOVE YOUR MOUSE CURSOR OVER THIS TEXT -

+{{{| +}}}} > +
+ +MOVE YOUR MOUSE CURSOR OVER THIS TEXT
- +
+
@@ -5858,7 +6009,7 @@ Special page transclusion !! result


-
Xyzzyx
+
Xyzzyx
!! end @@ -5871,10 +6022,10 @@ Special page transclusion twice (bug 5021) !! result


-
Xyzzyx
+
Xyzzyx


-
Xyzzyx
+
Xyzzyx
!! end @@ -6769,7 +6920,7 @@ Special:Search page linking. !! input {{Special:search}} !! result -

Special:Search +

Special:Search

!! end @@ -6874,37 +7025,72 @@ image4 |300px| centre !! test Gallery (with options) !! input - + File:Nonexistant.jpg|caption File:Nonexistant.jpg image:foobar.jpg|some '''caption''' [[Main Page]] image:foobar.jpg +image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. !! result -