!! Version 2 # Force the test runner to ensure the extension is loaded !! hooks section !! endhooks !! functionhooks lst lstx !! endfunctionhooks # This is the standard article assumed to exist. !! article Sections !! text 1
sec 1
2
sec 2
3
sec 3
a
sec a
...
!! endarticle !! article Sections in German !! text 1 sec 1 2 sec 2 3 sec 3 a sec a ... !! endarticle !! article Spacey sections !! text
sec spacey
!! endarticle #test to see what happens when we don't use LST. !! test LST: Normal rendering !! wikitext begin
middle
end !! html

begin middle end

!! end !! test LST: Normal (non-labelled) transclusion !! wikitext {{:sections}} !! html

1 sec 1

2 sec 2

3 sec 3

a sec a

...

!! end !! test LST: Transclude a section (#lst) !! wikitext {{#lst:sections|1}} !! html

sec 1

!! end !! test LST: Transclude a section in German (#lst) !! options language=de !! wikitext {{#lst:sections in German|1}} !! html

sec 1

!! end !! test LST: Transclude a section (#section) !! wikitext {{#section:sections|1}} !! html

sec 1

!! end !! test LST: Substitute a section !! options pst !! wikitext {{subst:#lst:sections|1}} !! html sec 1 !! end !! test LST: Substitute a section with quoted attributes !! wikitext {{#lst:sections|2}} !! html

sec 2

!! end !! test LST: Substitute a section with an optional / !! wikitext {{#lst:sections|3}} !! html

sec 3

!! end !! test LST: multiple sections with the same name !! wikitext {{#lst:sections|a}} !! html

sec a...

!! end !! test LST: Transclude range of sections !! wikitext {{#lst:sections|1|3}} !! html

sec 1

2 sec 2

3 sec 3

!! end !! test LST: Exclude a section !! wikitext {{#lstx:sections|1}} !! html

1

2 sec 2

3 sec 3

a sec a

...

!! end !! test LST: Exclude a range !! wikitext {{#lstx:sections|1||3}} !! html

1

a sec a

...

!! end !! test LST: Replace a section !! wikitext {{#lstx:sections|1|one}} !! html

1 one

2 sec 2

3 sec 3

a sec a

...

!! end !! test LST: Replace multiple sections !! wikitext {{#lstx:sections|a|A}} !! html

1 sec 1

2 sec 2

3 sec 3

a A

A

!! end !! test LST: Replace a range !! wikitext {{#lstx:sections|1|test|3}} !! html

1 test

a sec a

...

!! end !! article template:lst-sub !! text <section {{{1}}}=test/> !! endarticle !! test LST: Substitute a tag from a template !! options pst noxml !! wikitext {{subst:lst-sub|begin}} !! html
!! end !! article lst-nest !! text
I am outer
inner
!! endarticle !! test LST: Nested sections - inner section marks removed by tag hook. !! wikitext {{#lst:lst-nest|outer}} !! html

I am outer

inner


!! end !! test LST: red link from nonexistent article !! wikitext {{#lst:no such article|anything}} !! html

No such article

!! end # Note: MW <= 1.8 uses a different section header format. In these versions, the header out will look like this instead: #

section

!! article headings !! text
==section== blah
==section2== blah
!! endarticle !! test LST: Transcluded section headings create edit link to template !! wikitext {{#lst:headings|head}} !! html

section[edit]

blah

!! end !! test LST: Transcluded section headings create edit link to right section (mw 1.9r18218) !! wikitext {{#lst:headings|head2}} !! html

section2[edit]

blah

!! end !! article lst_head_bounds !! text === =2=
=3= hi =4=
=head4= !! endarticle !! test LST: more sensitive test for heading count boundaries. !! wikitext {{#lst:lst_head_bounds|s}} !! html

3[edit]

hi

4[edit]

!! end !! test LST: Nick's bogus input !! wikitext {{#lstx: {|}} !! html !! end !! article lst_javascript !! text
!! endarticle !! test LST: javascript !! wikitext {{#lst:lst javascript|ownage}} !! html

<script>alert("Ownage!");</script>

!! end !! article lst-slash !! text
slash
!! endarticle !! test LST: regexp special chars in section name !! wikitext {{#lst:lst-slash|/}} !! html

slash

!! end # We can't use the simplest case where the article transcludes itself # from a regression test (bug 8158). This test will segv if the cycle # detection code in the extension fails. !! article lst-cycle !! text
{{#lst:lst-cycle|cycle}}
!! endarticle !! test LST: cycle detection !! options !! wikitext {{#lst:lst-cycle|cycle}} !! html

Template loop detected: Lst-cycle

!! end #make sure we can still multiply-transclude (that is, path is cleared) !! test LST: multiple transclude !! wikitext {{#lst:sections|1}} {{#lst:sections|1}} !! html

sec 1 sec 1

!! end !! test LST: transclude nonexistent section !! wikitext {{#lst:sections|9999}} !! html !! end !! article LST-alt !! text
caps
junk
!! endarticle !! test LST: alternate caps !! wikitext {{#section:LST-alt|1}} !! html

caps

!! end !! test LST: useless options !! wikitext {{#section:LST-alt|2}} !! html

junk

!! end !! article lst-fromsection !! text Before...
SectionA
SectionB
SectionC
...After !! endarticle !! test LST: inclusion starting at a specified section till the end of article !! options !! wikitext {{#lst:lst-fromsection|B|}} !! html

SectionB SectionC ...After

!! end !! article lst-tosection !! text Before...
SectionA
SectionB
SectionC
...After !! endarticle !! test LST: inclusion from beginning of article to a specified section !! options !! wikitext {{#lst:lst-tosection||B}} !! html

Before... SectionA SectionB

!! end !! article lst-status !! text
c
sec a
sec b
sec c
!! endarticle !! test LST: Allow subtransclusion in lst argument (bug 42481) !! wikitext {{#lst:lst-status|latest}}: {{#lst:lst-status|{{#lst:lst-status|latest}}}} !! html

c: sec c

!! end !! article lst-selfinclusion1 !! text
Section A begin {{#lst:lst-selfinclusion2|B}} Section A end
!! endarticle !! article lst-selfinclusion2 !! text
Section B begin {{#lst:lst-selfinclusion1|A}} Section B end
!! endarticle !! test LST: verify self-inclusion fails !! options !! wikitext {{#lst:lst-selfinclusion1|A}} !! html

Section A begin

Section B begin Template loop detected: Lst-selfinclusion1 Section B end

Section A end

!! end !! article lst-redirected !! text #REDIRECT[[Sections]] !! endarticle !! test LST: Transclude a section via a redirect !! wikitext {{#lst:lst-redirected|1}} !! html

sec 1

!! end !! article lst-noinclude !! text before
sec a
after !! endarticle !! test LST: Noinclude tags should not be included - start at section !! wikitext {{#lst:lst-noinclude|a|}} !! html

sec a

!! end !! test LST: Noinclude tags should not be included - end at section !! wikitext {{#lst:lst-noinclude||a}} !! html

sec a

!! end !! article User:DifferentNamespace/subpage !! text
sec a
!! endarticle !! test LST: Transclusion from subpage in a non-standard namespace !! wikitext {{#lst:User:DifferentNamespace/subpage|a}} !! html

sec a

!! end !! test LST: Allow whitespace in section tag !! wikitext {{#lst:Spacey sections|spacey}} !! html

sec spacey

!! end