Error generation of unbalanced <ref><references/>: No error is shown if missing </ref>-tag is the last ref tag
Closed, ResolvedPublic

Description

If the missing </ref>-tag is the last ref tag, no error message is displayed.
Works correct: <ref>broken <ref>correct</ref> <references />
Doesn't work : <ref>broken <references />

See also https://bugzilla.wikimedia.org/show_bug.cgi?id=6199#c25 for comments on that


Version: unspecified
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=26145

bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz15712.
Tobias created this task.Sep 24 2008, 3:18 PM

I think this is fixed.

dunc_harris wrote:

No this isn't fixed per se:

the sequence "<ref><references/>" generates the error:

"Cite error: Cite error: There are <ref> tags on this page, but the references will not show without a <references/> tag."

But this is the wrong error message because there is indeed a <references/> in the page. The error should be:

"Cite error: Closing </ref> missing for <ref> tag"

or maybe even:

"Cite error: Closing </ref> missing for last <ref> tag"

Duplicate of Bug 21798

  • Bug 21798 has been marked as a duplicate of this bug. ***

(In reply to Duncan Harris from comment #2)

the sequence "<ref><references/>" generates the error:

"Cite error: Cite error: There are <ref> tags on this page, but the
references will not show without a <references/> tag."

But this is the wrong error message because there is indeed a <references/>
in the page. The error should be:

"Cite error: Closing </ref> missing for <ref> tag"

or maybe even:

"Cite error: Closing </ref> missing for last <ref> tag"

It doesn't output an error message anymore because, apparently because bug 66860 has been resolved and it now just silently eats the error message.

If the last </ref> was missing, then the reference list markup would get eaten and it would trigger 'MediaWiki:Cite error refs without references'. On enwiki, this would put the page into an error category and it would be fixed.

Bug 66860 added the automatic reference list, so 'MediaWiki:Cite error refs without references' is never triggered. Instead, the unclosed <ref> eats the following content and includes it in the last rendered reference.

Example:

<ref>1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Bu if the reference list markup exists, then the last reference is generated twice and the the reference list markup is exposed.

Example:

<ref>1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

<references />

There may be other instances where this renders differently.

Bumping up importance since we can no longer track and resolve this problem.

Since a references block is now automatically added if there isn't one, this now causes a different (and even more interesting) effect:

<ref>Foo</ref
Bar
<references/>

By the way, this seems to work in the desired way in Parsoid, see T58306 about the discrepancy.

mxn added a subscriber: mxn.Nov 25 2015, 12:37 AM

https://gerrit.wikimedia.org/r/#/c/255258/ "Preprocessor: Don't allow unclosed extension tags (matching until end of input)" is likely to help here, if it's merged. At least for simple cases like the one I gave above it's a lot saner. Not sure if it'll help for messier ones (but it'll change things around).

Izno moved this task from Backlog to Doing on the Cite board.Feb 20 2016, 3:05 AM
matmarex closed this task as "Resolved".Tue, Apr 5, 8:42 PM
matmarex claimed this task.
matmarex removed a project: Patch-For-Review.

https://gerrit.wikimedia.org/r/#/c/255258/ was merged, reverted due to issues with <noinclude>, then done again with that fixed as https://gerrit.wikimedia.org/r/#/c/268335/. I think this is resolved now.

<ref>Foo</ref
Bar
<references/>

There is no error message (Cite has no way to detect this), but we don't ruin the whole page's layout and the tag is simply displayed unparsed.

Add Comment