mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
If there's no main <references /> block on the page, show one automatically below the content
Rather than showing an error Bug: 66860 Change-Id: I9c7c13269d5ec355ccb280402aa8c0cedd208883
This commit is contained in:
parent
02b5cd9030
commit
798b453771
|
@ -1071,11 +1071,10 @@ class Cite {
|
|||
if ( count( $refs ) == 0 ) {
|
||||
continue;
|
||||
}
|
||||
$text .= "\n<br />";
|
||||
if ( $group == CITE_DEFAULT_GROUP ) {
|
||||
$text .= $this->error( 'cite_error_refs_without_references' );
|
||||
$text .= $this->referencesFormat( $group, '', '' );
|
||||
} else {
|
||||
$text .= $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
|
||||
$text .= "\n<br />" . $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -9,9 +9,11 @@ Simple <ref>, no <references/>
|
|||
!! input
|
||||
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
||||
!! result
|
||||
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
|
||||
<br /><strong class="error mw-ext-cite-error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
||||
</p>
|
||||
Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup><ol class="references">
|
||||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Proceeds of Rockology, vol. XXI</span>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -141,9 +143,11 @@ Templating<ref>Text<!--comment--></ref>
|
|||
!! input
|
||||
{{REVISIONID}}<ref>elite</ref>
|
||||
!! result
|
||||
<p>1337<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
|
||||
<br /><strong class="error mw-ext-cite-error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
||||
</p>
|
||||
1337<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup><ol class="references">
|
||||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">elite</span>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
"cite_error_no_link_label_group": "Ran out of custom link labels for group \"$1\".\nDefine more in the <nowiki>[[MediaWiki:$2]]</nowiki> message.",
|
||||
"cite_error_references_no_text": "Invalid <code><ref></code> tag;\nno text was provided for refs named <code>$1</code>",
|
||||
"cite_error_included_ref": "Closing <code></ref></code> missing for <code><ref></code> tag",
|
||||
"cite_error_refs_without_references": "<code><ref></code> tags exist, but no <code><references/></code> tag was found",
|
||||
"cite_error_group_refs_without_references": "<code><ref></code> tags exist for a group named \"$1\", but no corresponding <code><references group=\"$1\"/></code> tag was found, or a closing <code></ref></code> is missing",
|
||||
"cite_error_references_group_mismatch": "<code><ref></code> tag in <code><references></code> has conflicting group attribute \"$1\".",
|
||||
"cite_error_references_missing_group": "<code><ref></code> tag defined in <code><references></code> has group attribute \"$1\" which does not appear in prior text.",
|
||||
|
@ -38,4 +37,4 @@
|
|||
"cite_references_link_many_accessibility_label": "Jump up to:",
|
||||
"cite_references_prefix": "<ol class=\"references\">",
|
||||
"cite_references_suffix": "</ol>"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue