!! 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]
!! end
!! test
Subreferencing attribute allowed with feature flag set
!! config
wgCiteSubReferencing=true
!! wikitext
[def]
!! html/php
[1.1]
!! html/parsoid
[1.1]
!! 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]
!! 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.1]
!! 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
!! 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
!! 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
!! test
Empty content and 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
!! 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
!! options
parsoid=wt2html
!! 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
!! options
parsoid=wt2html
!! 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
# 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]
- ↑ The book Cite error:
<ref>
tag with name "book" cannot use details when inside <references>
.
!! html/parsoid
[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]
- ↑ 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
# 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]
!! html/parsoid
[1] [1.1] [1.2]
!! 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
!! 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.
!! 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