Reverting r45379 as per comment 5 on bug 16854, i.e. it doesn't work with section editing.

This commit is contained in:
Tim Starling 2009-01-07 13:10:29 +00:00
parent dc0f4c12b9
commit c3048a5e92
3 changed files with 3 additions and 25 deletions

View file

@ -44,8 +44,6 @@ Define more in the <nowiki>[[MediaWiki:Cite references link many format backlink
'cite_error_references_no_text' => 'Invalid <code>&lt;ref&gt;</code> tag;
no text was provided for refs named <code>$1</code>',
'cite_error_included_ref' => 'Closing &lt;/ref&gt; missing for &lt;ref&gt; tag',
'cite_error_refs_without_references' => '<code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found',
'cite_error_group_refs_without_references' => '<code>&lt;ref&gt;</code> tags exist for a group named "$1", but no corresponding <code>&lt;references group="$1"/&gt;</code> tag was found',
/*
Output formatting

View file

@ -426,7 +426,7 @@ class Cite {
// Named references with >1 occurrences
else {
$links = array();
//for group handling, we have an extra key here.
//for group handling, we have an extra key here.
for ( $i = 0; $i <= $val['count']; ++$i ) {
$links[] = wfMsgForContentNoTrans(
'cite_references_link_many_format',
@ -665,23 +665,6 @@ class Cite {
return true;
}
/**
* Called at the end of page processing to append an error if refs were
* used without a references tag.
*/
function checkRefsNoReferences( &$parser, &$text ) {
foreach ( $this->mRefs as $group => $refs ) {
if ( count( $refs ) == 0 ) continue;
$text .= "\n<br />";
if ( $group == CITE_DEFAULT_GROUP ) {
$text .= $this->error( 'cite_error_refs_without_references' );
} else {
$text .= $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
}
}
return true;
}
/**
* Initialize the parser hooks
@ -693,7 +676,6 @@ class Cite {
$wgParser->setHook( 'references' , array( &$this, 'references' ) );
$wgHooks['ParserClearState'][] = array( &$this, 'clearState' );
$wgHooks['ParserBeforeTidy'][] = array( &$this, 'checkRefsNoReferences' );
}
/**

View file

@ -11,7 +11,6 @@ Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
!! result
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
</p>
<br /><strong class="error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong>
!! end
!! test
@ -130,7 +129,6 @@ Templating<ref>Text<!--comment--></ref>
!! result
<p>1337<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
</p>
<br /><strong class="error">Cite error: <code>&lt;ref&gt;</code> tags exist, but no <code>&lt;references/&gt;</code> tag was found</strong>
!! end
!! test
@ -238,8 +236,8 @@ refs with no content must have a name</strong>
</p><p><strong class="error">Cite error: Invalid <code>&lt;references&gt;</code> tag;
no input is allowed. Use <code>&lt;references /&gt;</code></strong>
</p><p><strong class="error">Cite error: Invalid <code>&lt;references&gt;</code> tag;
parameter "group" is allowed only.
Use <code>&lt;references /&gt;</code>, or <code>&lt;references group="..." /&gt;</code></strong>
no parameters are allowed.
Use <code>&lt;references /&gt;</code></strong>
</p>
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Also zero, but differently! (Normal ref)</li>
<li id="cite_note-bar"><a href="#cite_ref-bar_0" title="">↑</a> <strong class="error">Cite error: Invalid <code>&lt;ref&gt;</code> tag;