**Author:** `cyp`
**Description:**
=#1=
==1.1: Issue==
{{#tag:ref}}s in a <references>
block supposedly cannot themselves
contain _unnamed_ <ref>s (see also #2, below)
==1.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
===Explanatory notes section===
<references group="n">
{{#tag:ref
|AAAA <ref>Ref #1</ref>
|group="n"|name="expl_A"}}
</references>
===References section===
<references />
<references />
==1.3 Test case result==
Failure. For one, it will generate a
"`<ref> tag defined in <references> has
no name attribute."` message.
Obviously, the <ref> here does not need a name.
Secondly, the <ref> will not be dealt with.
Third, just adding a name does not solve the
problem. See #2, below.
=#2=
==2.1: Issue==
For a _named_ <ref> (compare case #1) inside a
{{#tag:ref}} inside a <references> block,
the ref handler will carp and ignore the ref.
ignore the ref.
==2.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
===Explanatory notes section===
<references group="n">
{{#tag:ref
|AAAA <ref name="ref1">Ref #1</ref>
|group="n"|name="expl_A"}}
</references>
===References section===
<references />
<references />
==2.3 Test case result==
Failure. Error message
" `<ref> tag with name "ref1"
defined in <references> is not
used in prior text."
` The <ref> is not dealt with.
=#3=
==3.1: Issue==
ref handler will carp and ignore cross-refs
to an existing, predefined, named <ref>s
(compare case #1/#2)
==3.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
Carpe diem<ref name="ref1">Ref #1</ref>
===Explanatory notes section===
<references group="n">
{{#tag:ref
|AAAA <ref name="ref1" />
|group="n"|name="expl_A"}}
</references>
===References section===
<references />
<references />
==3.3 Test case result==
Failure. Error message
" `<ref> tag with name "ref1"
defined in <references> is not
used in prior text."
` The <ref> is not dealt with.
=#4=
==4.1: Issue==
A ref inside the <references> block that
is *only* linked from another ref in the
<references> block, is supposedly nonexistent.
==4.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
===Explanatory notes section===
<references group="n">
{{#tag:ref
|BBBB
|group="n"|name="expl_B"}}
{{#tag:ref
|AAAA link to B<ref name="expl_B" group="n" />
|group="n"|name="expl_A"}}
</references>
===References section===
<references />
<references />
==4.3: Test case result==
Failure. For one, it will twice
generate an inappropriate
"`<ref> tag with name "expl_B"
defined in <references> is not
used in prior text."
` (changing the order of the two
#tag:refs makes no difference)
Secondly, the <ref name="expl_B" group="n" />
/> is ignored.
If however the "expl_A" is moved into the
article text, everything is just fine.
=#5=
==5.1: Issue==
Corollary to #4: a ref tag that is *also*
used outside the <references> block will
*still* not appear.
==5.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
Carpe diem<ref name="expl_B" group="n" />
===Explanatory notes section===
<references group="n">
{{#tag:ref
|Explanation B
|group="n"|name="expl_B"}}
{{#tag:ref
|A link to B<ref name="expl_B" group="n" />
|group="n"|name="expl_A"}}
</references>
===References section===
<references />
<references />
==5.3: Test case result==
Failure. The <ref> inside the #tag:ref
is "invisible". No message.
=#6=
==6.1: Issue==
Ungraceful handling of refs that have
no backlinks
==6.2 Test case==
===Article text===
Some text (no refs)
===References section===
<references>
{{#tag:ref
|This is a ref without backlinks
|name="some_name"}}
</references>
</references>
==6.3 Test case result==
The ref handler will emit an "error" that
"<ref> tag with name "expl_B" defined
in <references> is not used in prior text."
This is unnecessary bitchiness that second
The ref handler will emit an "error" that `<ref> tag with name "expl_B" defined in <references> is not used in prior text.` This is unnecessary bitchiness that second guesses the editor. What the ref handler
really ought to do is print it without
backlinks (in a separate <ul>). If the
name has a typo, editors will figure it out.
[the same should be done for <ref>s in a
<references> block that have no name]
Editors ought not to be screamed at.
=#7=
==7.1: Issue==
If a note defined outside the <references> block is also referenced from inside the <references> block, the note
If a note defined outside the <references> block
is also referenced from inside the <references>
block, the note "disappears" entirely.
"disappears" entirely.
==7.2: Test case==
===Article text===
Lorem ipsum<ref name="expl_A" group="n" />
similique sunt in culpa<ref
name="expl_B" group="n" />
cognito ergo poof.{{#tag:ref|AAAAA
|group="n"|name="expl_A"}}
===Explanatory notes section===
<references group="n">
{{#tag:ref|Link to expl. A.<ref
name="expl_A" group="n" />
|name="expl_B" |group="n"}}
</references>
</references>
==7.3 Test case result==
The note expl_A disappears. Instead,
a spurious "error" message is emitted in
in its place.
"Invalid <ref> tag; `Invalid <ref> tag; no text was provided
for refs named expl_A"`
=Notes=
A)* These problems are all limited to tags inside
<references>...</references>. They don't apply
outside the <references> block.
B)* The ref handler is much too emphatic. It probably
needs to deal with input gracefully, and not shake
its fist at editors so much. Please.
--------------------------
**Version**: unspecified
**Severity**: normal
**See Also**:
https://bugzilla.wikimedia.org/show_bug.cgi?id=20707