Template:Section link/testcases

Lua code Wikitext code Result
mSectionLink('Paris','Architecture') {{section link|Paris|Architecture}} Paris § Architecture
{{section link/sandbox|Paris|Architecture}} Paris § Architecture
mSectionLink('Paris',{'Architecture','Culture'}) {{section link|Paris|Architecture|Culture}} Paris §§ Architecture​ and Culture
{{section link/sandbox|Paris|Architecture|Culture}} Paris §§ Architecture​ and Culture
mSectionLink('Paris',{'Architecture','Culture','Sport'}) {{section link|Paris|Architecture|Culture|Sport}} Paris §§ Architecture, Culture, and Sport
{{section link/sandbox|Paris|Architecture|Culture|Sport}} Paris §§ Architecture, Culture, and Sport
mSectionLink('Paris',{'Architecture','Culture','Sport'},{nopage=true}) {{section link|Paris|Architecture|Culture|Sport|nopage=yes}} §§ Architecture, Culture, and Sport
{{section link/sandbox|Paris|Architecture|Culture|Sport|nopage=yes}} §§ Architecture, Culture, and Sport
Case 1: no parameters
{{Section link}}

{{Section link}}

Template:Section link/testcases § Notes

{{Section link/sandbox}}

Template:Section link/testcases § Notes

Case 2: only one parameter
{{Section link|Section}}

{{Section link}}

Section § Notes

{{Section link/sandbox}}

Section § Notes

Case 3: article and section
{{Section link|Article|Section}}

{{Section link}}

Article § Section

{{Section link/sandbox}}

Article § Section

Case 4a: only section (Null article parameter)
{{Section link||Section}}

{{Section link}}

§ Section

{{Section link/sandbox}}

§ Section

Case 4b: only section (No article parameter at all)
{{Section link|2=Section}}

{{Section link}}

Template:Section link/testcases § Section

{{Section link/sandbox}}

Template:Section link/testcases § Section

Case 4c: only section (No article parameter at all and nopage set)
{{Section link|2=Section|nopage=yes}}

{{Section link}}

§ Section

{{Section link/sandbox}}

§ Section

Case 5: article and 2 sections
{{Section link|Article|Section 1|Section 2}}

{{Section link}}

Article §§ Section 1​ and Section 2

{{Section link/sandbox}}

Article §§ Section 1​ and Section 2

Case 6: article and 3 sections
{{Section link|Article|Section 1|Section 2|Section 3}}

{{Section link}}

Article §§ Section 1, Section 2, and Section 3

{{Section link/sandbox}}

Article §§ Section 1, Section 2, and Section 3

Case 7: article and 4 sections
{{Section link|Article|Section 1|Section 2|Section 3|Section 4}}

{{Section link}}

Article §§ Section 1, Section 2, Section 3, and Section 4

{{Section link/sandbox}}

Article §§ Section 1, Section 2, Section 3, and Section 4

Case 8: article and 5 sections
{{Section link|Article|Section 1|Section 2|Section 3|Section 4|Section 5}}

{{Section link}}

Article §§ Section 1, Section 2, Section 3, Section 4, and Section 5

{{Section link/sandbox}}

Article §§ Section 1, Section 2, Section 3, Section 4, and Section 5

Case 9a: 5 sections only (null article parameter)
{{Section link||Section 1|Section 2|Section 3||Section 5}}

{{Section link}}

§§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 1, Section 2, Section 3, and Section 5

Case 9b: 5 sections only (no article parameter and 5th positional parameter)
{{Section link|2=Section 1|3=Section 2|4=Section 3|6=Section 5}}

{{Section link}}

Template:Section link/testcases §§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

Template:Section link/testcases §§ Section 1, Section 2, Section 3, and Section 5

Case 9c: 5 sections only (no article parameter, 5th positional parameter, and nopage set)
{{Section link|2=Section 1|3=Section 2|4=Section 3|6=Section 5|nopage=yes}}

{{Section link}}

§§ Section 1, Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 1, Section 2, Section 3, and Section 5

Case 10 (misuse): only positional parameters 3, 4 and 6
{{Section link|||Section 2|Section 3||Section 5}}

{{Section link}}

§§ Section 2, Section 3, and Section 5

{{Section link/sandbox}}

§§ Section 2, Section 3, and Section 5

Case 11 (misuse): only positional parameters 4 and 6
{{Section link||||Section 3||Section 5}}

{{Section link}}

§§ Section 3​ and Section 5

{{Section link/sandbox}}

§§ Section 3​ and Section 5

Case 12: subpage links
{{Section link|../|Usage}}

{{Section link}}

../ § Usage

{{Section link/sandbox}}

../ § Usage

Case 13: display title
{{Section link|Wikipedia:Page name|Section|display=:wikipedia: _ ''p''a<sup>g</sup><sub>e</sub>_'''''n''a'''&#109;<sup><sup>e</sup></sup>}}

{{Section link}}

:wikipedia: _ page_name § Section

{{Section link/sandbox}}

:wikipedia: _ page_name § Section

Case 14: non-matching display title
{{Section link|Wikipedia:Page name|Section|display=WP:PNAME}}

{{Section link}}

Lua error: Display title "WP:PNAME" was ignored since it is not equivalent to the page's actual title.

{{Section link/sandbox}}

Lua error: Display title "WP:PNAME" was ignored since it is not equivalent to the page's actual title.

Case 15: anchor in title
{{Section link|Article#Section}}

{{Section link}}

Article § Section

{{Section link/sandbox}}

Article § Section

Case 16: anchor in title and section
{{Section link|Article#Section 1|Section 2}}

{{Section link}}

Article §§ Section 1​ and Section 2

{{Section link/sandbox}}

Article §§ Section 1​ and Section 2