X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=368dc0d2134de56e67fcd441d10f4a7cc1796063;hb=33e4ac5b220b0edbef6774b3d961a3313fbf76e9;hp=be6e3a89965a40ed398ee9976e7893ca60b5bcc5;hpb=8bb5a6c461c31ee5ce6874548246fc2c520686f6;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index be6e3a8996..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
{{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[http://example.com x +
[http://example.com x +
[[Foo +
{{echo|[[Foo}} +
+!! html/parsoid + + +[[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) !! html/parsoid - + @@ -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 +
!! html/php+tidy -Bug462 Bug462
+ !! html/parsoid !! end @@ -8047,7 +8124,7 @@ title=[[0]] !! wikitext [[0]] !! html -0 +
!!end @@ -8503,7 +8580,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Main Page]] !! html/php -local:Main Page +
!! html/parsoid @@ -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/* !! 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 +
+foo
+{{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 parameterThis is a test template with parameter
!! 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 @@ -14272,7 +14455,7 @@ Entities in file name and attributes !! html/parsoid - + !! end !! test @@ -14487,7 +14670,7 @@ wgEnableUploads=0 !! 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 -
The tooltips shall not show entities to the user (ie. be double escaped)
-Id should not contain + for spaces
-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) !! html/parsoid - + !! end !! test @@ -17351,10 +17552,10 @@ Sanitizer: Validating that and work, but only for Microdata<meta http-equiv="refresh" content="5"> -
<link rel="stylesheet" href="http://example.org"> +http://
{{{|
-
-
MOVE YOUR MOUSE CURSOR OVER THIS TEXT