X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=2d107e7752d7decf5b204f98e87f6b6c109f9f5b;hb=f9de807e28c5194ef4e2ddbcf31375041816fab6;hp=be6e3a89965a40ed398ee9976e7893ca60b5bcc5;hpb=6cdcc7416c64a635df9aa15170d2df13ecbbd82d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index be6e3a8996..2d107e7752 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 @@ -8015,10 +8092,10 @@ title=[[Bug462]] !! wikitext [[Bug462]] [[Bug462]] !! html/php -

Bug462 Bug462 +

Bug462 Bug462

!! html/php+tidy -

Bug462 Bug462

+

Bug462 Bug462

!! html/parsoid

Bug462 Bug462

!! end @@ -8047,7 +8124,7 @@ title=[[0]] !! wikitext [[0]] !! html -

0 +

0

!!end @@ -8503,7 +8580,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Main Page]] !! html/php -

local:Main Page +

local:Main Page

!! html/parsoid

local:Main Page

@@ -9962,9 +10039,10 @@ Magic Words LOCAL (UTC) Magic Word: {{FULLPAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{FULLPAGENAME}} -!! html +!! html/*

User:Ævar Arnfjörð Bjarmason

!! end @@ -9973,9 +10051,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{FULLPAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{FULLPAGENAMEE}} -!! html +!! html/*

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end @@ -9984,9 +10063,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{TALKSPACE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKSPACE}} -!! html +!! html/*

User talk

!! end @@ -9995,9 +10075,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{TALKSPACE}}, same namespace !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKSPACE}} -!! html +!! html/*

User talk

!! end @@ -10006,9 +10087,10 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]] Magic Word: {{TALKSPACE}}, main namespace !! options title=[[Parser Test]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKSPACE}} -!! html +!! html/*

Talk

!! end @@ -10017,9 +10099,10 @@ title=[[Parser Test]] Magic Word: {{TALKSPACEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKSPACEE}} -!! html +!! html/*

User_talk

!! end @@ -10028,9 +10111,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBJECTSPACE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTSPACE}} -!! html +!! html/*

User

!! end @@ -10039,9 +10123,10 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBJECTSPACE}}, same namespace !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTSPACE}} -!! html +!! html/*

User

!! end @@ -10050,9 +10135,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBJECTSPACE}}, main namespace !! options title=[[Parser Test]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTSPACE}} -!! html +!! html/* !! end @@ -10060,9 +10146,10 @@ title=[[Parser Test]] Magic Word: {{SUBJECTSPACEE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTSPACEE}} -!! html +!! html/*

User

!! end @@ -10071,9 +10158,10 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]] Magic Word: {{NAMESPACE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{NAMESPACE}} -!! html +!! html/*

User

!! end @@ -10082,9 +10170,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{NAMESPACEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{NAMESPACEE}} -!! html +!! html/*

User

!! end @@ -10093,9 +10182,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{NAMESPACENUMBER}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{NAMESPACENUMBER}} -!! html +!! html/*

2

!! end @@ -10104,9 +10194,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBPAGENAME}} -!! html +!! html/*

sub ö

!! end @@ -10115,9 +10206,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage Magic Word: {{SUBPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBPAGENAMEE}} -!! html +!! html/*

sub_%C3%B6

!! end @@ -10126,9 +10218,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage Magic Word: {{ROOTPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{ROOTPAGENAME}} -!! html +!! html/*

Ævar Arnfjörð Bjarmason

!! end @@ -10137,9 +10230,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage Magic Word: {{ROOTPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{ROOTPAGENAMEE}} -!! html +!! html/*

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end @@ -10148,9 +10242,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage Magic Word: {{BASEPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{BASEPAGENAME}} -!! html +!! html/*

Ævar Arnfjörð Bjarmason

!! end @@ -10159,9 +10254,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub]] subpage Magic Word: {{BASEPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub]] subpage +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{BASEPAGENAMEE}} -!! html +!! html/*

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end @@ -10170,9 +10266,10 @@ title=[[Ævar Arnfjörð Bjarmason/sub]] subpage Magic Word: {{TALKPAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKPAGENAME}} -!! html +!! html/*

User talk:Ævar Arnfjörð Bjarmason

!! end @@ -10181,9 +10278,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{TALKPAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKPAGENAMEE}} -!! html +!! html/*

User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end @@ -10192,9 +10290,10 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBJECTPAGENAME}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTPAGENAME}} -!! html +!! html/*

User:Ævar Arnfjörð Bjarmason

!! end @@ -10203,18 +10302,21 @@ title=[[User talk:Ævar Arnfjörð Bjarmason]] Magic Word: {{SUBJECTPAGENAMEE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTPAGENAMEE}} -!! html +!! html/*

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{NUMBEROFFILES}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{NUMBEROFFILES}} -!! html +!! html/*

7

!! end @@ -10223,9 +10325,10 @@ Magic Word: {{NUMBEROFFILES}} Magic Word: {{PAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAME}} -!! html +!! html/*

Ævar Arnfjörð Bjarmason

!! end @@ -10234,6 +10337,7 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{PAGENAME}} with metacharacters !! options title=[['foo & bar = baz']] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext ''{{PAGENAME}}'' !! html/php @@ -10247,6 +10351,7 @@ title=[['foo & bar = baz']] Magic Word: {{PAGENAME}} with metacharacters (T28781) !! options title=[[*RFC 1234 http://example.com/]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAME}} !! html/php @@ -10260,9 +10365,10 @@ title=[[*RFC 1234 http://example.com/]] Magic Word: {{PAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAMEE}} -!! html +!! html/*

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end @@ -10271,6 +10377,7 @@ title=[[User:Ævar Arnfjörð Bjarmason]] Magic Word: {{PAGENAMEE}} with metacharacters (T28781) !! options title=[[*RFC 1234 http://example.com/]] +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAMEE}} !! html/php @@ -10282,53 +10389,65 @@ title=[[*RFC 1234 http://example.com/]] !! test Magic Word: {{REVISIONID}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{REVISIONID}} -!! html +!! html/*

1337

!! end !! test Magic Word: {{SCRIPTPATH}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SCRIPTPATH}} -!! html +!! html/* !! end !! test Magic Word: {{STYLEPATH}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{STYLEPATH}} -!! html +!! html/*

/skins

!! end !! test Magic Word: {{SERVER}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SERVER}} -!! html +!! html/*

http://example.org

!! end !! test Magic Word: {{SERVERNAME}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SERVERNAME}} -!! html +!! html/*

example.org

!! end !! test Magic Word: {{SITENAME}} +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SITENAME}} -!! html +!! html/*

MediaWiki

!! end @@ -10337,18 +10456,21 @@ Magic Word: {{SITENAME}} Magic Word: {{PAGELANGUAGE}} !! options language=fr +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGELANGUAGE}} -!! html +!! html/*

fr

!! end !! test Magic Word: {{PAGELANGUAGE}} on a page with no explicitly set language +!! options +parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGELANGUAGE}} -!! html +!! html/*

en

!! end @@ -10389,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 @@ -10960,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 @@ -10975,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 @@ -11207,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 @@ -13066,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 @@ -13745,7 +13928,7 @@ Manually-specified thumbnail image !! options thumbsize=220 !! wikitext -[[File:Foobar.jpg|thumb=Thumb.png|Title]] +[[File:Foobar.jpg|thumbnail=Thumb.png|Title]] !! html/php
Title
@@ -14272,7 +14455,7 @@ Entities in file name and attributes

7% solution

!! html/parsoid -

+

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

File:Foobaz.jpg

!! html/parsoid -

+

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

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

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

[[./../foo|bar]] [[foo/.|bar]] @@ -15331,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 ### @@ -15413,7 +15602,7 @@ Section headings with TOC Some text ===Another headline=== !! html -

Contents

+

Contents

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

      Contents

      +

      Contents

      • 1 Headline 2
      • 2 Headline
      • @@ -15487,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
            @@ -15540,7 +15729,7 @@ TOC regression (T11764) == title 2 == === title 2.1 === !! html -

            Contents

            +

            Contents

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

                Contents

                +

                Contents

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

                Contents

                +

                Contents

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

                    Contents

                    +

                    Contents

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

                        Contents

                        +

                        Contents

                        • 1 title 1
                            @@ -15793,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
                            • @@ -15852,7 +16041,7 @@ section 6 !! html

                              Id should not contain + for spaces

                              -

                              Contents

                              +

                              Contents

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

                                Contents

                                +

                                Contents

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

                                  Contents

                                  +

                                  Contents

                                  • 1 Header 1
                                      @@ -16328,18 +16517,22 @@ Nesting of Media link !! wikitext [[Media:Foobar.jpg]] -!! html +!! html/php

                                      Media:Foobar.jpg

                                      +!! html/parsoid +

                                      Media:Foobar.jpg

                                      !! end !! test Media link with text !! wikitext [[Media:Foobar.jpg|A neat file to look at]] -!! html +!! html/php

                                      A neat file to look at

                                      +!! html/parsoid +

                                      A neat file to look at

                                      !! end # FIXME: this is still bad HTML tag nesting @@ -16348,21 +16541,29 @@ Media link with text Media link with nasty text !! wikitext [[Media:Foobar.jpg|Safe Link
                                      " onmouseover="alert(document.cookie)" onfoo="
                                      ]] -!! html +!! html/php Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> -!! html+tidy +!! html+php/tidy

                                      Safe Link

                                      " onmouseover="alert(document.cookie)" onfoo="
                                      +!! html/parsoid +

                                      Safe Link

                                      + !! end !! test Media link to nonexistent file (T3702) !! wikitext [[Media:No such.jpg]] -!! html +[[Media:No_such file.jpg]] +!! html/php

                                      Media:No such.jpg +Media:No_such file.jpg

                                      +!! html/parsoid +

                                      Media:No such.jpg +Media:No_such file.jpg

                                      !! end !! test @@ -16373,7 +16574,7 @@ Image link to nonexistent file (T3850 - good)

                                      File:No such.jpg

                                      !! html/parsoid -

                                      +

                                      !! end !! test @@ -17381,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 # @@ -17706,7 +17905,7 @@ Fuzz testing: Parser14 http://__TOC__ !! html

                                      onmouseover=[edit]

                                      -http://

                                      Contents

                                      +http://

                                      Contents

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

                                      Contents

                                      onmouseover=[edit]

                                      http://

                                      -
                                      +

                                      Contents

                                        @@ -17842,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

                                        @@ -17920,7 +18119,7 @@ Fuzz testing: image with bogus manual thumbnail
                                        Error creating thumbnail:
                                        !! html/parsoid -
                                        +
                                        !! end !! test @@ -19069,6 +19268,27 @@ title=[[Parser test]] !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. +!! test +Gallery with valid attributes +!! wikitext + +File:File:Foobar.jpg + +!! html/php + + +!! html/parsoid + +!! end + ## Parsoid thinks the "centre" here is a property, not a caption. !! test Gallery @@ -19613,6 +19833,56 @@ File:Test.png !! end +!! test +Gallery with class and style attributes +!! options +parsoid={ + "nativeGallery": true +} +!! wikitext + +File:Foobar.jpg + +!! html/php + + +!! html/parsoid + +!! end + +!! test +Gallery in slideshow mode +!! options +parsoid={ + "nativeGallery": true +} +!! wikitext + +File:Foobar.jpg + +!! html/php + + +!! html/parsoid + +!! end + !! test HTML Hex character encoding (spells the word "JavaScript") !! options @@ -19871,7 +20141,7 @@ djvu

                                        LoremIpsum.djvu

                                        !! html/parsoid -

                                        +

                                        !! end !! test @@ -20129,7 +20399,7 @@ Out-of-order TOC heading levels =====5===== ==2== !! html -

                                        Contents

                                        +

                                        Contents

                                        • 1 2
                                            @@ -20170,9 +20440,11 @@ ISBN --- ISBN with space-delimited number !! wikitext ISBN 92 9017 032 8 -!! html +!! html/php

                                            ISBN 92 9017 032 8

                                            +!! html/parsoid +

                                            ISBN 92 9017 032 8

                                            !! end @@ -20194,11 +20466,17 @@ ISBN 123456789 ISBN 1234567890 ISBN 12345678901 -!! html +!! html/php

                                            ISBN 123456789

                                            ISBN 1234567890

                                            ISBN 12345678901

                                            +!! html/parsoid +

                                            ISBN 123456789

                                            + +

                                            ISBN 1234567890

                                            + +

                                            ISBN 12345678901

                                            !! end @@ -20208,10 +20486,14 @@ ISBN with trailing year (T9110) ISBN 1-234-56789-0 - 2006 ISBN 1 234 56789 0 - 2006 -!! html +!! html/php

                                            ISBN 1-234-56789-0 - 2006

                                            ISBN 1 234 56789 0 - 2006

                                            +!! html/parsoid +

                                            ISBN 1-234-56789-0 - 2006

                                            + +

                                            ISBN 1 234 56789 0 - 2006

                                            !! end @@ -20327,7 +20609,7 @@ title=[[Dunav]] language=sr !! wikitext Both [[Dunav]] and [[Дунав]] are names for this river. !! html -

                                            Both Dunav and Дунав are names for this river. +

                                            Both Dunav and Дунав are names for this river.

                                            !!end @@ -20344,7 +20626,7 @@ title=[[Duna]] language=sr !! wikitext [[Дуна]] is not a self-link while [[Duna]] and [[Dуна]] are still self-links. !! html -

                                            Дуна is not a self-link while Duna and Dуна are still self-links. +

                                            Дуна is not a self-link while Duna and Dуна are still self-links.

                                            !! end @@ -20355,7 +20637,7 @@ title=[[Duna]] language=sr !! wikitext [[Dуна]] is a self-link while [[Dunа#Foo]] and [[Dуна#Foo]] are not self-links. !! html -

                                            Dуна is a self-link while Dunа#Foo and Dуна#Foo are not self-links. +

                                            Dуна is a self-link while Dunа#Foo and Dуна#Foo are not self-links.

                                            !! end @@ -21793,7 +22075,7 @@ showindicators !! wikitext -!! html +!! html/php

                                            Error: Page status indicators' name attribute must not be empty. Error: Page status indicators' name attribute must not be empty.

                                            @@ -21806,7 +22088,7 @@ showindicators !! wikitext -!! html +!! html/php empty= name=


                                            @@ -21833,7 +22115,7 @@ showindicators Two paragraphs -!! html +!! html/php 01=hello world 02=Main Page 03=Foobar.jpg @@ -21965,7 +22247,7 @@ percent-encoding and + signs in internal links (T28410) !! html/parsoid

                                            User:+% Page+title% %+ %20 %+ %+r -% + +% + 3E 3E+

                                            !! end @@ -21979,8 +22261,8 @@ Special characters in embedded file links (T29679) Title with & ampersand

                                            !! html/parsoid -

                                            -

                                            +

                                            +

                                            !! end !! test @@ -22103,6 +22385,12 @@ language=en

                                            !! end +# Note that Parsoid doesn't emit an explicit TOC. +# Note also that the html2wt direction tends to emit an extra newline +# between the __TOC__ magicword and the first heading unless *both* +# the and the

                                            have a data-parsoid attribute set (even if +# it's "{}"). + !! test T28375: TOC with italics !! options @@ -22110,8 +22398,8 @@ title=[[Main Page]] !! wikitext __TOC__ == ''Lost'' episodes == -!! html -

                                            Contents

                                            +!! html/php +

                                            Contents

                                            @@ -22119,6 +22407,9 @@ __TOC__

                                            Lost episodes[edit]

                                            +!! html/parsoid + +

                                            Lost episodes

                                            !! end !! test @@ -22128,8 +22419,8 @@ title=[[Main Page]] !! wikitext __TOC__ == '''should be bold''' then normal text == -!! html -

                                            Contents

                                            +!! html/php +

                                            Contents

                                            @@ -22137,6 +22428,9 @@ __TOC__

                                            should be bold then normal text[edit]

                                            +!! html/parsoid + +

                                            should be bold then normal text

                                            !! end !! test @@ -22146,8 +22440,8 @@ title=[[Main Page]] !! wikitext __TOC__ == Image [[Image:foobar.jpg]] == -!! html -

                                            Contents

                                            +!! html/php +

                                            Contents

                                            @@ -22155,6 +22449,9 @@ __TOC__

                                            Image Foobar.jpg[edit]

                                            +!! html/parsoid + +

                                            Image

                                            !! end !! test @@ -22164,8 +22461,8 @@ title=[[Main Page]] !! wikitext __TOC__ ==
                                            Quote
                                            == -!! html -

                                            Contents

                                            +!! html/php +

                                            Contents

                                            @@ -22173,10 +22470,10 @@ __TOC__

                                            Quote
                                            [edit]

                                            -!! html+tidy +!! html/php+tidy

                                            -
                                            +

                                            Contents

                                              @@ -22189,6 +22486,9 @@ __TOC__

                                              Quote

                                              [edit]

                                              +!! html/parsoid + +

                                              Quote

                                              !! end !! test @@ -22200,8 +22500,8 @@ __TOC__ == Proof: 2 < 3 == Hanc marginis exiguitas non caperet. QED -!! html -

                                              Contents

                                              +!! html/php +

                                              Contents

                                              @@ -22211,6 +22511,11 @@ QED

                                              Hanc marginis exiguitas non caperet. QED

                                              +!! html/parsoid + +

                                              Proof: 2 < 3

                                              +

                                              Hanc marginis exiguitas non caperet. +QED

                                              !! end !! test @@ -22220,8 +22525,8 @@ __TOC__ == Foo Bar == == Foo
                                              Bar
                                              == -!! html -

                                              Contents

                                              +!! html/php +

                                              Contents

                                              • 1 Foo Bar
                                              • 2 Foo Bar
                                              • @@ -22231,10 +22536,10 @@ __TOC__

                                                Foo Bar[edit]

                                                Foo
                                                Bar
                                                [edit]

                                                -!! html+tidy +!! html/php+tidy

                                                -
                                                +

                                                Contents

                                                  @@ -22249,6 +22554,10 @@ __TOC__

                                                  Bar

                                                  [edit]

                                                  +!! html/parsoid + +

                                                  Foo Bar

                                                  +

                                                  Foo
                                                  Bar

                                                  !! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to @@ -22263,7 +22572,7 @@ __TOC__ == Evilbye == !! html/php -

                                                  Contents

                                                  +

                                                  Contents

                                                  • 1 Hello
                                                  • 2 b">Evilbye
                                                  • @@ -22293,8 +22602,8 @@ __TOC__ == All attributes on these span tags must be deleted from the TOC == == Attributes after dir on these span tags must be deleted from the TOC == -!! html -

                                                    Contents

                                                    +!! html/php +

                                                    Contents

                                                    • 1 C++
                                                    • 2 זבנג!
                                                    • @@ -22310,6 +22619,13 @@ __TOC__

                                                      All attributes on these span tags must be deleted from the TOC[edit]

                                                      Attributes after dir on these span tags must be deleted from the TOC[edit]

                                                      +!! html/parsoid + +

                                                      C++

                                                      +

                                                      זבנג!

                                                      +

                                                      The attributes on these span tags must be deleted from the TOC

                                                      +

                                                      All attributes on these span tags must be deleted from the TOC

                                                      +

                                                      Attributes after dir on these span tags must be deleted from the TOC

                                                      !! end !! test @@ -22317,8 +22633,8 @@ T74884: bdi element in ToC !! wikitext __TOC__ == test == -!! html -

                                                      Contents

                                                      +!! html/php +

                                                      Contents

                                                      @@ -22326,6 +22642,9 @@ __TOC__

                                                      test[edit]

                                                      +!! html/parsoid + +

                                                      test

                                                      !! end !! test @@ -22333,8 +22652,8 @@ T35715: s/strike element in ToC !! wikitext __TOC__ == test test test == -!! html -

                                                      Contents

                                                      +!! html/php +

                                                      Contents

                                                      @@ -22342,6 +22661,9 @@ __TOC__

                                                      test test test[edit]

                                                      +!! html/parsoid + +

                                                      test test test

                                                      !! end # Note that the html output does not have the

                                                      , but the @@ -22352,8 +22674,8 @@ Empty

                                                      tag in TOC, removed by Sanitizer (T92892) !! wikitext __TOC__ == x == -!! html -

                                                      Contents

                                                      +!! html/php +

                                                      Contents

                                                      @@ -22361,10 +22683,10 @@ __TOC__

                                                      x[edit]

                                                      -!! html+tidy +!! html/php+tidy

                                                      -
                                                      +

                                                      Contents

                                                        @@ -22373,6 +22695,9 @@ __TOC__

                                                      x[edit]

                                                      +!! html/parsoid + +

                                                      x

                                                      !! end !! article @@ -22746,14 +23071,12 @@ parsoid={ ## recognized as an extension tag w/o a native handler. !! test LST Sections: Newfangled approach -!! options -parsoid={ "suppressErrors": true } !! wikitext
                                                      !! html/parsoid -

                                                      <section begin="2011-05-16" /> -<section end="2014-04-10 (MW 1.23wmf22)" />

                                                      +

                                                      <section begin="2011-05-16" /> +<section end="2014-04-10 (MW 1.23wmf22)" />

                                                      !! end #--------- Test stripping of empty nodes in template content ---------- @@ -23780,7 +24103,8 @@ Links 4. ExtLinks: Escapes needed parsoid=html2wt !! html/parsoid

                                                      [google] -google]

                                                      +google] +goog] le

                                                      [http://google.com]

                                                      [http://google.com google]

                                                      [http://google.com]

                                                      @@ -23788,6 +24112,7 @@ parsoid=html2wt !! wikitext [http://google.com [google]] [http://google.com google]] +[http://google.com goog] le] [http://google.com] @@ -23799,6 +24124,7 @@ parsoid=html2wt !! html/php

                                                      [google] google] +goog] le

                                                      [http://google.com]

                                                      [http://google.com google]

                                                      [http://google.com] @@ -24142,7 +24468,7 @@ parsoid=html2wt !! test 4. No escaping needed !! options -options=html2wt +parsoid=html2wt !! html/parsoid

                                                      'bar' 'bar' @@ -24279,7 +24605,7 @@ parsoid=html2wt !! test 4. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options -options=html2wt +parsoid=html2wt !! html/parsoid

                                                      caption
                                                      !! wikitext @@ -26582,6 +26908,16 @@ parsoid=html2wt [http://test.com][[one]] two three !! end +!! test +Catch regression when unpacking misnested links +!! options +parsoid=wt2html +!! wikitext +{{echo|hi}}[http://example.com [[ho]]] +!! html/parsoid +

                                                      hiho

                                                      +!! end + !! test Use data-parsoid.firstWikitextNode to compute newline constraints for template content !! options @@ -26633,6 +26969,20 @@ parsoid= { # Tests spec'ing wikitext serialization norms | # -------------------------------------------- +!! test +Serialize multi-line indent-pre starting with wikitext syntax +!! options +parsoid=html2wt +!! html/parsoid +
                                                      * 1
                                                      +** 2
                                                      +* 3
                                                      +!! wikitext + * 1 + ** 2 + * 3 +!! end + !! test 1. Categories should always be serialized on their own line !! options @@ -27364,6 +27714,20 @@ d |} !! end +!! test +Anchor without href scenarios +!! options +parsoid={ "modes": ["html2wt"], "suppressErrors": true } +!! html/parsoid + +dice + +!! wikitext + +dice + +!! end + # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content