X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fparser%2FparserTests.txt;h=368dc0d2134de56e67fcd441d10f4a7cc1796063;hb=33e4ac5b220b0edbef6774b3d961a3313fbf76e9;hp=7bf2ce2199e993e367d4f0d578e918fe7cd82abd;hpb=9b4fd6a6c054a8b012ea0d358478f3ee1c392469;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 7bf2ce2199..368dc0d213 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -32,6 +32,7 @@ # local format section links in edit comment text as local links # notoc disable table of contents # thumbsize=NNN set the default thumb size to NNNpx for this test +# wrap include the normal wrapper
(since 1.30) # # You can also set the following parser properties via test options: # wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, @@ -2735,6 +2736,39 @@ Templates: Don't strip whitespace from positional-param values !! end +!! test +Templates: Don't recognize targets split by newlines +!! options +parsoid=wt2html +!! wikitext +{{ech +o|foo}} +!! html/php +

{{ech +o|foo}} +

+!! html/parsoid +

{{ech +o|foo}}

+!! end + +!! test +Templates: Recognize targets when newlines and comments don't split the target +!! options +parsoid=wt2html +!! wikitext +{{ + echo + + + |foo}} +!! html/php +

foo +

+!! html/parsoid +

foo

+!! end + !! test Templates: Handle empty comment-and-ws-only lines correctly !! wikitext @@ -5271,6 +5305,49 @@ Bracketed external links with template-generated invalid target

!! end +# wt2html only because Parsoid would want to add s coming from html +!! test +Broken wikilinks (but not external links) prevent templates from closing +!! options +parsoid=wt2html +!! wikitext +[http://example.com x + +{{echo|[http://example.com x}} + +[[Foo + +{{echo|[[Foo}} +!! html/php +

[http://example.com x +

[http://example.com x +

[[Foo +

{{echo|[[Foo}} +

+!! html/parsoid +

[http://example.com x

+

[http://example.com x

+

[[Foo

+

{{echo|[[Foo}}

+!! end + +!! test +Broken templates +!! options +parsoid=wt2html +!! wikitext +{{echo|[[Foo|}}]] + +[[Foo|{{echo|]]}} +!! html/php +

{{echo|}} +

[[Foo|]] +

+!! html/parsoid +

{{echo|}}

+

[[Foo|]]

+!! end + !! test T4702: Mismatched , and tags are invalid !! wikitext @@ -7847,7 +7924,7 @@ File containing double quotes and spaces !! wikitext [[File:Cool "Gator".png]] !! html/parsoid -

+

!! end !! test @@ -7895,7 +7972,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted)

Pentecoste

!! html/parsoid -

+

''Pentecoste''

Pentecoste

Pentecoste

@@ -7915,10 +7992,10 @@ Broken image links with HTML captions (T41700) abc

!! html/parsoid -

- - -

+

+ + +

!! end !! test @@ -10434,15 +10511,26 @@ Parsoid: Page property magic word with magic word contents !! wikitext {{DISPLAYTITLE:''{{PAGENAME}}''}} !! html/parsoid - + !! end +# NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better. +# But, this is a limitation of our representation and is documented in +# TemplateHandler.js in processSpecialMagicWord !! test Parsoid: Template-generated DISPLAYTITLE !! wikitext {{{{echo|DISPLAYTITLE}}:Foo}} +!! options +showtitle +!! config +wgAllowDisplayTitle=true +wgRestrictDisplayTitle=false +!! html/php +Foo + !! html/parsoid - + !! end !! test @@ -11005,6 +11093,39 @@ Template with complex template as argument

!! end +!! test +Templates with templated name +!! wikitext +{{{{echo|echo}}|foo}} +{{{{echo|inner list}} }} +!! html +

foo +

+
  • item 1
+ +!! html/parsoid +

foo

+
  • item 1
+!! end + +# Parsoid markup is deliberate "broken". This is an edge case. +# See long comment in TemplateHandler.js:convertAttribsToString. +!! test +Templates with invalid templated targets +!! wikitext +{{echo +{{echo|foo}} +}} +!! html/php +

{{echo +foo +}} +

+!! html/parsoid +

{{echo +foo }}

+!! end + !! test Template with thumb image (with link in description) !! wikitext @@ -11020,7 +11141,7 @@ This is a test template with parameter
This is a test template with parameter

link caption
+

This is a test template with parameter

link caption
!! end !! article @@ -11252,17 +11373,23 @@ T2041: Template parameters shown as broken links !! test Template with targets containing wikilinks +!! options +parsoid=wt2html !! wikitext {{[[foo]]}} {{[[{{echo|foo}}]]}} {{{{echo|[[foo}}]]}} -!! html +!! html/php

{{foo}}

{{foo}}

{{[[foo}}]]

+!! html/parsoid +

{{foo}}

+

{{foo}}

+

{{[[foo}}]]

!! end !! article @@ -13111,6 +13238,17 @@ pst [[:Bar:Article (context),context|Article]] !! end +!! test +Parsoid: backwards pipe trick +!! wikitext +[[|'''bar''']] +!! html/php +

[[|bar]] +

+!! html/parsoid +

[[|bar]]

+!! end + !! test pre-save transform: trim trailing empty lines !! options @@ -14317,7 +14455,7 @@ Entities in file name and attributes

7% solution

!! html/parsoid -

+

!! end !! test @@ -14532,7 +14670,7 @@ wgEnableUploads=0

File:Foobaz.jpg

!! html/parsoid -

+

!! end # Parsoid-specific testing for images @@ -14865,6 +15003,7 @@ Render invalid page names as plain text (T53090) [[.]] [[..]] [[foo././bar]] +[[foo[http://example.com]xyz]] [[{{echo|./../foo}}|bar]] [[{{echo|foo/.}}|bar]] @@ -14888,6 +15027,7 @@ Render invalid page names as plain text (T53090) [[.]] [[..]] [[foo././bar]] +[[foo[1]xyz]]

[[./../foo|bar]] [[foo/.|bar]] [[foo/..|bar]] @@ -14910,7 +15050,8 @@ Render invalid page names as plain text (T53090) [[foo[bar]] [[.]] [[..]] -[[foo././bar]]

+[[foo././bar]] +[[fooxyz]]

[[./../foo|bar]] [[foo/.|bar]] @@ -15376,12 +15517,15 @@ Parsoid: Defaultsort !! end +# NOTE: mw:ExpandedAttrs is not the best typeof here. mw:Transclusion is better. +# But, this is a limitation of our representation and is documented in +# TemplateHandler.js in processSpecialMagicWord !! test Parsoid: Defaultsort (template-generated) !! wikitext {{{{echo|DEFAULTSORT}}:Foo}} !! html/parsoid - + !! end ### @@ -15458,7 +15602,7 @@ Section headings with TOC Some text ===Another headline=== !! html -

Contents

+

Contents

  • 1 Headline 1
      @@ -15501,7 +15645,7 @@ __FORCETOC__ == Headline 2 == == Headline == !! html/php -

      Contents

      +

      Contents

      • 1 Headline 2
      • 2 Headline
      • @@ -15532,7 +15676,7 @@ Handling of sections up to level 6 and beyond ========= Level 9 Heading========= ========== Level 10 Heading========== !! html -

        Contents

        +

        Contents

        • 1 Level 1 Heading
            @@ -15585,7 +15729,7 @@ TOC regression (T11764) == title 2 == === title 2.1 === !! html -

            Contents

            +

            Contents

            • 1 title 1
                @@ -15620,7 +15764,7 @@ TOC for heading containing (T96153) __FORCETOC__ ==New title== !! html/php -

                Contents

                +

                Contents

                @@ -15642,7 +15786,7 @@ wgMaxTocLevel=3 == title 2 == === title 2.1 === !! html -

                Contents

                +

                Contents

                • 1 title 1
                    @@ -15678,7 +15822,7 @@ wgMaxTocLevel=3 ====Section 1.1.1.1==== ==Section 2== !! html -

                    Contents

                    +

                    Contents

                    • 1 Section 1
                        @@ -15771,7 +15915,7 @@ __TOC__ === title 1.1 === == title 2 == !! html -

                        Contents

                        +

                        Contents

                        • 1 title 1
                            @@ -15838,7 +15982,7 @@ section 5 !! html

                            The tooltips shall not show entities to the user (ie. be double escaped)

                            -

                            Contents

                            +

                            Contents

                            • 1 text > text
                            • 2 text < text
                            • @@ -15897,7 +16041,7 @@ section 6 !! html

                              Id should not contain + for spaces

                              -

                              Contents

                              +

                              Contents

                              • 1 Space between Text
                              • 2 Space-Entity between Text
                              • @@ -15943,7 +16087,7 @@ Headers with excess '=' characters =''italic'' heading== ==''italic'' heading= !! html -

                                Contents

                                +

                                Contents

                                • 1 foo=
                                • 2 =foo
                                • @@ -15973,7 +16117,7 @@ HTML headers vs TOC (T25393) == Header 2.2 == __NOEDITSECTION__ !! html -

                                  Contents

                                  +

                                  Contents

                                  !! end @@ -17426,14 +17582,12 @@ all additional text is vanished !! test Self closed html pairs (T7487) -!! options !! wikitext
                                  Centered text
                                  In div text
                                  -!! html -
                                  <font id="bug" />Centered text
                                  -
                                  <font id="bug2" />In div text
                                  - +!! html+tidy +
                                  Centered text
                                  +
                                  In div text
                                  !! end # @@ -17751,7 +17905,7 @@ Fuzz testing: Parser14 http://__TOC__ !! html

                                  onmouseover=[edit]

                                  -http://

                                  Contents

                                  +http://

                                  Contents

                                  @@ -17762,7 +17916,7 @@ http://

                                  Contents

                                  onmouseover=[edit]

                                  http://

                                  -
                                  +

                                  Contents

                                    @@ -17887,8 +18041,8 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT !! html/parsoid

                                    {{{| - -

                                    MOVE YOUR MOUSE CURSOR OVER THIS TEXT

                                    +}}}} > +

                                    MOVE YOUR MOUSE CURSOR OVER THIS TEXT

                                    @@ -17965,7 +18119,7 @@ Fuzz testing: image with bogus manual thumbnail
                                    Error creating thumbnail:
                                    !! html/parsoid -
                                    +
                                    !! end !! test @@ -19129,6 +19283,10 @@ File:File:Foobar.jpg +!! html/parsoid + !! end ## Parsoid thinks the "centre" here is a property, not a caption. @@ -19676,17 +19834,17 @@ File:Test.png !! end !! test -Gallery with class attribute +Gallery with class and style attributes !! options parsoid={ "nativeGallery": true } !! wikitext - + File:Foobar.jpg !! html/php -