!! options version=2 parsoid-compatible=wt2html,wt2wt,html2wt,html2html !! end !! article Template:Deco-z !! text z{{{1}}}zz !! endarticle !! test Subreferencing attribute blocked without feature flag !! config wgCiteSubReferencing=false !! wikitext def !! html/php

Cite error: Invalid parameter in `<ref>` tag

!! html/parsoid

[1]

1. ↑ def

!! end !! test Subreferencing attribute allowed with feature flag set !! config wgCiteSubReferencing=true !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ 0

!! html/parsoid

[1.1]

1. def
2. ↑ 0

!! end # T389363: Fix attribute order round-tripping for main+details references !! test Subreferencing round trips in reverse alphabetical attribute order !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ 0

!! html/parsoid

[1.1]

1. def
2. ↑ 0

!! end !! test Unnamed main reference with a lonely sub-ref, neither can be reused !! config wgCiteSubReferencing=true !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ abc

!! html/parsoid

[1]

1. ↑ def

!! end !! test Named main ref with inline details !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

[1.1]

1. ↑ The book
   1. ↑ p. 1

!! html/parsoid

[1.1]

1. The book
2. ↑ p. 1

!! end # FIXME: Can we make the whitespace survive the roundtrip? !! test Empty sub-referencing attribute with no meaningful content !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext def !! html/php

[1]

1. ↑ def

!! html/parsoid

[1]

1. ↑ def

!! end # FIXME: restore self-closing references tag !! test Multiple subreferences !! config wgCiteSubReferencing=true !! wikitext def jkl !! html/php

[1.1] [2.1]

1. ↑ def
   1. ↑ abc
2. ↑ jkl
   1. ↑ ghi

!! html/parsoid

[1.1] [2.1]

1. def
2. ↑ abc
3. jkl
4. ↑ ghi

!! end !! test Parent reference used before sub-reference !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

[1] [1.1]

1. ↑ The book
   1. ↑ p. 1

!! html/parsoid

[1] [1.1]

1. ↑ The book
2. ↑ p. 1

!! end !! test Parent reference used after sub-reference !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

[1.1] [1]

1. ↑ The book
   1. ↑ p. 1

!! html/parsoid

[1.1] [1]

1. ↑ The book
2. ↑ p. 1

!! end !! test Unused, list-defined parent reference !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

[1.1]

1. ↑ The book
   1. ↑ p. 1

!! html/parsoid

[1.1]

1. The book
2. ↑ p. 1

!! end !! test No main content due to missing name or empty content !! config wgCiteSubReferencing=true !! wikitext !! html/php

Cite error: A `<ref>` tag with details must contain content or point to a parent reference by name.

!! html/parsoid

[1]

1. ↑

!! end !! test Empty content and no name !! config wgCiteSubReferencing=true !! wikitext !! html/php

Cite error: A `<ref>` tag with details must contain content or point to a parent reference by name.

!! html/parsoid

[1]

1. ↑

!! end !! test No main content due to missing named main ref !! config wgCiteSubReferencing=true !! wikitext !! html/php

[1.1]

1. ↑ Cite error: Invalid `<ref>` tag; no text was provided for refs named `missingbook`
   1. ↑ page 1

!! html/parsoid

[1.1]

2. ↑ page 1

!! end !! test Empty content and missing named main ref !! config wgCiteSubReferencing=true !! wikitext !! html/php

[1.1]

1. ↑ Cite error: Invalid `<ref>` tag; no text was provided for refs named `missingbook`
   1. ↑ page 1

!! html/parsoid

[1.1]

2. ↑ page 1

!! end !! test Empty details content with name, ignored outside of !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1]

1. ↑ Book

!! html/parsoid

[1]

1. ↑ Book

!! end !! test Empty details content without name, ignored outside of !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1]

1. ↑ Book

!! html/parsoid

[1]

1. ↑ Book

!! end !! test Empty details content inside of !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1]

1. ↑ Book Cite error: `<ref>` tag with name "a" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑ Book

!! end !! test Unused list-defined sub-ref with no name !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

Cite error: `<ref>` tag with name "" cannot use details when inside `<references>`.

!! html/parsoid

1. Book

!! end # T390974: Bad refs don't round-trip !! test Unused list-defined sub-ref with linked existing main ref !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book !! html/php

[1]

1. ↑ Book

Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑ Book
2. page 1

!! end !! test There is no such thing as a list-defined sub-ref (completely unused) !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.

!! html/parsoid

1. The book
2. p. 1

!! end # T390961: fails to round-trip main+details after main !! test Unused list defined sub-ref with used main content !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book Book !! html/php

[1]

1. ↑ Book Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑
2. page 1
3. page 2

!! end !! test Unused list defined sub-ref with used main content (same as above but with #tag) !! config wgCiteSubReferencing=true !! wikitext {{#tag:references|Book Book}} !! html/php

[1]

1. ↑ Book Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑
2. page 1
3. page 2

!! end # T390961: fails to round-trip main+details after main !! test There is no such thing as a list-defined sub-ref (duplicate main content) !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext The book The book !! html/php

[1]

1. ↑ The book Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑ The book
2. p. 1

!! end # Missing content breaks round-tripping. !! test Unused list defined sub-ref due to duplicate details content !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book !! html/php

[1.1]

1. ↑ Book Cite error: `<ref>` tag with name "book" cannot use details when inside `<references>`.
   1. ↑ page 1

!! html/parsoid

[1.1]

2. ↑ page 1
3. page 1

!! end # T390992: detect conflicting main ref content in main+details !! test Conflicting main content !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book Book, but different !! html/php

[1.1] [1.2]

1. ↑ Book Cite error: Invalid `<ref>` tag; name "book" defined multiple times with different content
   1. ↑ page 1
   2. ↑ page 2

!! html/parsoid

[1.1] [1.2]

1. Book
2. ↑ page 1
3. ↑ page 2

!! end # T390961: fails to round-trip main+details after main !! test Repeating the main content when using details !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book Book Book !! html/php

[1] [1.1] [1.2]

1. ↑ Book
   1. ↑ page 1
   2. ↑ page 1

!! html/parsoid

[1] [1.1] [1.2]

1. ↑ Book
2. ↑ page 1
3. ↑ page 1

!! end # TODO: Specify desired behavior. Bad round-trip. !! test Using `follow` with details on the "main" part !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book continued !! html/php

[1.1]

1. ↑ Book continued
   1. ↑ page 1

!! html/parsoid

[1.1] [1]

1. Book continued
2. ↑ page 1

!! end # T390974: Bad refs don't round-trip !! test Using `follow` with details on the "follow" part !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book continued !! html/php

[1] Cite error: A `<ref follow="…">` tag that is the continuation of a previous one cannot be named individually or have details.

1. ↑ Book

!! html/parsoid

[1] [1]

1. ↑ Book continued

!! end !! test Details include basic wikitext syntax !! config wgCiteSubReferencing=true !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ abc

!! html/parsoid

[1.1]

1. def
2. ↑ abc

!! end !! test Details include template invocation !! config wgCiteSubReferencing=true !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ zabczz

!! html/parsoid

[1.1]

1. def
2. ↑ zabczz

!! end # TODO: Should be blocked with a fatal, identical to how the main content behaves; see T380979 !! test Details include another, nested ref tag !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext x a !! html/php

[1] [2.1]

1. ↑ x
2. ↑ a
   1. ↑ d[1]

!! html/parsoid

[1] [2.1]

1. ↑ x
2. a
3. ↑ d

!! end !! test Subreference doesn't affect main reference numbering !! config wgCiteSubReferencing=true !! wikitext abc ghi jkl !! html/php

[1] [2.1] [3]

1. ↑ abc
2. ↑ ghi
   1. ↑ def
3. ↑ jkl

!! html/parsoid

[1] [2.1] [3]

1. ↑ abc
2. ghi
3. ↑ def
4. ↑ jkl

!! end # T390961: fails to round-trip main+details after main !! test Subreference of existing ref doesn't affect main reference numbering !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext abc abc jkl !! html/php

[1] [1.1] [2]

1. ↑ abc
   1. ↑ def
2. ↑ jkl

!! html/parsoid

[1] [1.1] [2]

1. ↑ abc
2. ↑ def
3. ↑ jkl

!! end !! test Rolling back a sub-reference inside the #tag:references function !! config wgCiteSubReferencing=true !! wikitext {{#tag:references|a b}} !! html/php

[1]

1. ↑ a

Cite error: `<ref>` tag with name "b" cannot use details when inside `<references>`.

!! html/parsoid

[1]

1. ↑ a
2. b
3. p1

!! end