X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=e62eb80f1171e096aa5d23acf5bd9ef9f33165de;hb=31a52f9e3d49d452f4aef95491de7ad75ed4ccc3;hp=3a15ed5a3b4f7ebb21546771ba3aef0f8c34e68b;hpb=dd99a81648687ef209bfa6871efb439e28e25481;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 3a15ed5a3b..e62eb80f11 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -71,6 +71,24 @@ Template:echo {{{1}}} !! endarticle +!! article +Template:echo_with_span +!! text +{{{1}}} +!! endarticle + +!! article +Template:echo_with_div +!! text +
{{{1}}}
+!! endarticle + +!! article +Template:attr_str +!! text +{{{1}}}="{{{2}}}" +!! endarticle + ### ### Basic tests ### @@ -4046,6 +4064,14 @@ Template parameter as link source

!! end +!!test +Template-generated attribute string (k='v') +!!input +bar +!!result +

bar +

+!!end !!article Template:paramtest2 @@ -4326,7 +4352,7 @@ section=1 ### and in attributes ### !!test -1. includeonly around the entire attribute +0. includeonly around the entire attribute !!input id="v1"id="v2">bar !!result @@ -4335,7 +4361,7 @@ section=1 !!end !!test -2. includeonly in html attr key +1. includeonly in html attr key !!input idabout="foo">bar !!result @@ -4344,7 +4370,7 @@ section=1 !!end !!test -3. includeonly in html attr value +2. includeonly in html attr value !!input bar "v1""v2">bar @@ -4355,7 +4381,7 @@ section=1 !!end !!test -4. includeonly in part of an attr value +3. includeonly in part of an attr value !!input bar !!result @@ -4694,6 +4720,48 @@ Templates: Tables: 4f. Generating a single tag of a HTML table !!end +!!test +Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo) +!!input +{{echo|''a}}{{echo|b''c''d}}{{echo|''e}} +!!result +

abcde +

+!!end + +!!test +Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) +(PHP parser generates misnested html) +!! options +disabled +!!input +{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} +!!result +

abcde

+!!end + +!!test +Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div) +(PHP parser generates misnested html) +!! options +disabled +!!input +{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} +!!result +
a
+
bcd
+
e
+!!end + +!!test +Templates: Ugly nesting: 4. Divs opened/closed across templates +!!input +a
b{{echo|c
d}}e +!!result +a
bc
de + +!!end + !!test Parser Functions: 1. Simple example !!input @@ -5372,6 +5440,15 @@ Image with caption !! end +!! test +Image with empty attribute +!! input +[[Image:foobar.jpg|right||Caption text]] +!! result +
Caption text
+ +!! end + !! test Image with link parameter, wiki target !! input @@ -5466,7 +5543,7 @@ Thumbnail image with link parameter !! input [[Image:foobar.jpg|thumb|link=http://example.com/|Title]] !! result -
Title
+
Title
!! end @@ -5540,7 +5617,7 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result -
+
!! end @@ -5549,7 +5626,7 @@ Thumbnail image caption with a free URL and explicit alt !! input [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] !! result -
Alteration
+
Alteration
!! end @@ -5558,7 +5635,7 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result -
+
!! end @@ -5567,7 +5644,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 @@ -5576,7 +5653,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result -
+
!! end @@ -5649,7 +5726,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
This is a caption with another image inside it!
+
This is a caption with another image inside it!
!! end @@ -5669,7 +5746,7 @@ Bug 3090: External links other than http: in image captions !! input [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] !! result -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end @@ -5839,6 +5916,39 @@ pst [[Category:Foo (bar)|Foo]] !! end +!! test +Category with template +!! options +cat +pst +!! input +[[Category:{{echo|Foo}}]] +!! result +[[Category:{{echo|Foo}}]] +!! end + +!! test +Category with template in sort key +!! options +cat +pst +!! input +[[Category:Foo|{{echo|Bar}}]] +!! result +[[Category:Foo|{{echo|Bar}}]] +!! end + +!! test +Category with template in sort key and title +!! options +cat +pst +!! input +[[Category:{{echo|Foo}}|{{echo|Bar}}]] +!! result +[[Category:{{echo|Foo}}|{{echo|Bar}}]] +!! end + ### ### Inter-language links ### @@ -8799,19 +8909,19 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
  • -
    +

    some caption Main Page

  • -
    Foobar.jpg
    +
    Foobar.jpg
  • -
    This is a foo-bar.
    +
    This is a foo-bar.

    Blabla|blabla.

    @@ -8831,14 +8941,14 @@ File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt !! result