!! 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]
- ↑ def Cite error: Invalid parameter "details" in
<ref> tag. The supported parameters are: dir, follow, group, name.
!! html/parsoid
[1]
!! end
!! test
T397760: Details with no name but feature flag disabled
!! config
wgCiteSubReferencing=false
!! wikitext
[x]
!! html/php
[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]
!! html/parsoid
[1.1]
!! end
!! test
Subreference round trip with original attribute order
!! config
wgCiteSubReferencing=true
!! wikitext
[def]
!! html/php
[1.1]
!! html/parsoid
[1.1]
!! end
!! test
Unnamed main reference with a lonely sub-ref, neither can be reused
!! config
wgCiteSubReferencing=true
!! wikitext
[def]
!! html/php
[1]
- ↑ def Cite error: Invalid
<ref> tag; missing name attribute. A name attribute must be provided along with a details attribute.
!! html/parsoid
[1]
!! end
!! test
Named main ref with inline details
!! config
wgCiteSubReferencing=true
!! wikitext
[The book]
!! html/php
[1.1]
!! html/parsoid
[1.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]
!! html/parsoid
[1]
!! end
# FIXME: restore self-closing references tag
!! test
Multiple subreferences
!! config
wgCiteSubReferencing=true
!! wikitext
[def] [jkl]
!! html/php
[1.1] [2.1]
!! html/parsoid
[1.1] [2.1]
!! end
!! test
Parent reference used before sub-reference
!! config
wgCiteSubReferencing=true
!! wikitext
[The book]
!! html/php
[1] [1.1]
!! html/parsoid
[1] [1.1]
!! end
!! test
Parent reference used after sub-reference
!! config
wgCiteSubReferencing=true
!! wikitext
[The book]
!! html/php
[1.1] [1]
!! html/parsoid
[1.1] [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]
!! html/parsoid
[1.1] [1.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]
!! html/parsoid
[1.1] [1.2] [1]
!! end
!! test
Unused, list-defined parent reference
!! config
wgCiteSubReferencing=true
!! wikitext
[The book]
!! html/php
[1.1]
!! html/parsoid
[1.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]
!! 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]
!! end
!! test
No main content due to missing named main ref
!! config
wgCiteSubReferencing=true
!! wikitext
!! html/php
[1.1]
- ↑ Cite error: Invalid
<ref> tag; no text was provided for refs named missingbook
- ↑ page 1
!! html/parsoid
[1.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]
- ↑ Cite error: Invalid
<ref> tag; no text was provided for refs named missingbook
- ↑ page 1
!! html/parsoid
[1.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]
!! html/parsoid
[1][1.1]
!! end
!! test
Empty details content with name, ignored outside of
!! config
wgCiteSubReferencing=true
!! wikitext
[Book]
!! html/php
[1]
!! html/parsoid
[1]
!! end
!! test
Empty details content without name, ignored outside of
!! config
wgCiteSubReferencing=true
!! wikitext
[Book]
!! html/php
[1]
!! html/parsoid
[1]
!! end
!! test
Empty details content inside of
!! config
wgCiteSubReferencing=true
!! wikitext
[Book]
!! html/php
[1]
- ↑ Book Cite error:
<ref> tag with name "a" cannot use details when inside <references>.
!! html/parsoid
[1]
!! 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
!! 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]
Cite error: <ref> tag with name "book" cannot use details when inside <references>.
!! html/parsoid
[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
!! 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]
- ↑ Book Cite error:
<ref> tag with name "book" cannot use details when inside <references>.
!! html/parsoid
[1]
!! 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]
- ↑ Book Cite error:
<ref> tag with name "book" cannot use details when inside <references>.
!! html/parsoid
[1]
!! 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]
- ↑ The book Cite error:
<ref> tag with name "book" cannot use details when inside <references>.
!! html/parsoid
[1]
!! end
!! test
Unused list defined sub-ref due to duplicate details content
!! config
wgCiteSubReferencing=true
!! wikitext
[Book]
!! html/php
[1.1]
- ↑ Book Cite error:
<ref> tag with name "book" cannot use details when inside <references>.
- ↑ page 1
!! html/parsoid
[1.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]
- ↑ Book Cite error: Invalid
<ref> tag; name "book" defined multiple times with different content
- ↑ page 1
- ↑ page 2
!! html/parsoid
[1.1] [1.2]
!! end
!! test
Repeating the main content when using details
!! config
wgCiteSubReferencing=true
!! wikitext
[Book] [Book] [Book]
!! html/php
[1] [1.1] [1.1]
!! html/parsoid
[1] [1.1] [1.1]
!! end
!! test
T410125: Identical sub-refs in different sections must be independent
!! config
wgCiteSubReferencing=true
!! wikitext
[content]
[different]
!! html/php
[1.1]
[1.1]
!! html/parsoid
[1.1]
[1.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]
!! html/parsoid
[1.1][1.1]
!! 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]
!! html/parsoid
[1.1][1.1]
!! 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]
!! html/parsoid
[1][1.1][1.1]
!! 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]
!! html/parsoid
[1.1][2.1][1.1][2.1]
- Book A
- 1 2 p1
- Book B
- 1 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]
- ↑ Book Cite error: One of the
<ref> tags with the name "a" does have a conflicting dir attribute.
- ↑ 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.
!! 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]
- ↑ Book Cite error: Invalid
<ref> tag; name "a" defined multiple times with different content
- ↑ 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]
- ↑ Book continued
- ↑ page 1
!! html/parsoid
[1.1] [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.
!! html/parsoid
[1] [1]
!! end
!! test
Details include basic wikitext syntax
!! config
wgCiteSubReferencing=true
!! wikitext
[def]
!! html/php
[1.1]
!! html/parsoid
[1.1]
!! end
!! test
Details include template invocation
!! config
wgCiteSubReferencing=true
!! wikitext
[def]
!! html/php
[1.1]
!! html/parsoid
[1.1]
!! 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]
!! html/parsoid
[1] [2.1]
!! end
!! test
Subreference doesn't affect main reference numbering
!! config
wgCiteSubReferencing=true
!! wikitext
[abc] [ghi] [jkl]
!! html/php
[1] [2.1] [3]
!! html/parsoid
[1] [2.1] [3]
!! 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]
!! html/parsoid
[1] [1.1] [2]
!! end
!! test
Rolling back a sub-reference inside the #tag:references function
!! config
wgCiteSubReferencing=true
!! wikitext
{{#tag:references|[a][b]}}
!! html/php
[1]
Cite error: <ref> tag with name "b" cannot use details when inside <references>.
!! html/parsoid
[1]
!! 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]
- ↑ The book
- ↑ p. 1
- ↑ Another book
!! html/parsoid
[1.1] [2]
- The book
- ↑ p. 1
- ↑ 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]
!! 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