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

[1]

1. ↑ def Cite error: Invalid parameter "details" in `<ref>` tag. The supported parameters are: dir, follow, group, name.

!! html/parsoid

[1]

1. ↑ def

!! end !! test T397760: Details with no name but feature flag disabled !! config wgCiteSubReferencing=false !! wikitext x !! html/php

[1]

1. ↑ x Cite error: Invalid parameter "details" in `<ref>` tag. The supported parameters are: dir, follow, group, name.

!! 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
   1. ↑ 0

!! end !! test Subreference round trip with original attribute order !! config wgCiteSubReferencing=true !! wikitext def !! html/php

[1.1]

1. ↑ def
   1. ↑ 0

!! html/parsoid

[1.1]

1. def
   1. ↑ 0

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

[1]

1. ↑ def Cite error: Invalid `<ref>` tag; missing name attribute. A name attribute must be provided along with a details attribute.

!! 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
   1. ↑ 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,html2html !! 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
   1. ↑ abc
2. jkl
   1. ↑ 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
   1. ↑ 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
   1. ↑ p. 1

!! end # FIXME: restore self-closing references tag !! test Main+details reference used after sub-reference !! config wgCiteSubReferencing=true !! wikitext The book !! html/php

[1.1] [1.2]

1. ↑ The book
   1. ↑ p. 1
   2. ↑ p. 2

!! html/parsoid

[1.1] [1.2]

1. The book
   1. ↑ p. 1
   2. ↑ p. 2

!! end # FIXME: restore self-closing references tag !! test Main+details reference used after sub-reference and standalone main ref !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext The book The book !! html/php

[1.1] [1.2] [1]

1. ↑ The book
   1. ↑ p. 1
   2. ↑ p. 2

!! html/parsoid

[1.1] [1.2] [1]

1. ↑ The book
   1. ↑ p. 1
   2. ↑ p. 2

!! 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
   1. ↑ 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]

1. 1. ↑ page 1

!! end # FIXME: Currently fails round-trips because becomes , see T392195 !! test Empty content and missing named main ref !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! 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]

1. 1. ↑ page 1

!! end # FIXME: Currently fails round-trips because becomes , see T392195 !! test T392195: Details get lost on sub-ref with empty main content !! config wgCiteSubReferencing=true !! options parsoid=wt2html !! wikitext Book !! html/php

[1][1.1]

1. ↑ Book
   1. ↑ page 1

!! html/parsoid

[1][1.1]

1. ↑ Book
   1. ↑ 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 !! 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

!! 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

!! end # T390961: fails to round-trip main+details after main !! test Unused list defined sub-ref with used main content !! config wgCiteSubReferencing=true !! 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. ↑ Book

!! 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. ↑ Book

!! end !! test There is no such thing as a list-defined sub-ref (duplicate main content) !! config wgCiteSubReferencing=true !! 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

!! end !! test Unused list defined sub-ref due to duplicate details content !! config wgCiteSubReferencing=true !! 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]

1. Book
   1. ↑ 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
   1. ↑ page 1
   2. ↑ 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.1]

1. ↑ Book
   1. ↑ 1.0 1.1 page 1

!! html/parsoid

[1] [1.1] [1.2]

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

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs with inline main that do not repeat the main content !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1.1][1.1]

1. ↑ Book
   1. ↑ 1.0 1.1 p1

!! html/parsoid

[1.1][1.2]

1. Book
   1. ↑ p1
   2. ↑ p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs with inline main that do repeat the main content !! config wgCiteSubReferencing=true !! wikitext Book Book !! html/php

[1.1][1.1]

1. ↑ Book
   1. ↑ 1.0 1.1 p1

!! html/parsoid

[1.1][1.2]

1. Book
   1. ↑ p1
   2. ↑ p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs with standalone main !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1][1.1][1.1]

1. ↑ Book
   1. ↑ 1.0 1.1 p1

!! html/parsoid

[1][1.1][1.2]

1. ↑ Book
   1. ↑ p1
   2. ↑ p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs with multiple list-defined main refs !! config wgCiteSubReferencing=true !! wikitext Book A Book B !! html/php

[1.1][2.1][1.1][2.1]

1. ↑ Book A
   1. ↑ 1.0 1.1 p1
2. ↑ Book B
   1. ↑ 2.0 2.1 p1

!! html/parsoid

[1.1][2.1][1.2][2.2]

1. Book A
   1. ↑ p1
   2. ↑ p1
2. Book B
   1. ↑ p1
   2. ↑ p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs should not suppress error message for mismatching dir !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

[1.1] [1.1]

1. ↑ Book Cite error: One of the `<ref>` tags with the name "a" does have a conflicting dir attribute.
   1. ↑ 1.0 1.1 p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs should not suppress error message for misplaced follow !! config wgCiteSubReferencing=true !! wikitext Book !! html/php

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

1. ↑ Book
   1. ↑ p1

!! end # T406467: Parsoid doesn't do any merging yet !! test Merging sub-refs should not suppress error message for conflicting main content !! config wgCiteSubReferencing=true !! wikitext Book conflict !! html/php

[1.1] [1.1]

1. ↑ Book Cite error: Invalid `<ref>` tag; name "a" defined multiple times with different content
   1. ↑ 1.0 1.1 p1

!! 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
   1. ↑ page 1

!! end # T390974: Bad refs don't round-trip !! test Using `follow` with details on the "follow" part !! config wgCiteSubReferencing=true !! 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
   1. ↑ 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
   1. ↑ 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
   1. ↑ 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
   1. ↑ def
3. ↑ 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
   1. ↑ def
2. ↑ 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

!! end !! test Named main ref with inline details and called with #tag !! config wgCiteSubReferencing=true !! wikitext The book Another book {{#tag:references}} !! html

[1.1] [2]

1. ↑ The book
   1. ↑ p. 1
2. ↑ Another book

!! html/parsoid

[1.1] [2]

1. The book
   1. ↑ p. 1
2. ↑ Another book

!! end # T389929 We don't want Parsoid to convert a synthetic list defined refs into ref tags !! test Synthetic main refs from VE dont convert to list defined refs !! config wgCiteSubReferencing=true !! options parsoid=html2wt !! wikitext Miller Smith !! html/parsoid

[1.1] [2]

1. Miller
   1. page 1
2. Smith

!! end !! test T406002: Selser detects edits to the main part of a main+details !! config wgCiteSubReferencing=true !! options parsoid={ "modes": ["selser"], "changes": [["#x", "remove"]], "selser": "noauto" } !! wikitext Originalbody !! wikitext/edited body !! html/parsoid !! end