From 798b4537712ea448b863eaf57800dfec685d6ff7 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 23 Jun 2014 22:42:17 +0100 Subject: [PATCH] If there's no main block on the page, show one automatically below the content Rather than showing an error Bug: 66860 Change-Id: I9c7c13269d5ec355ccb280402aa8c0cedd208883 --- Cite_body.php | 5 ++--- citeParserTests.txt | 16 ++++++++++------ i18n/core/en.json | 3 +-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Cite_body.php b/Cite_body.php index 8cb1cc0bd..d59c6780d 100644 --- a/Cite_body.php +++ b/Cite_body.php @@ -1071,11 +1071,10 @@ class Cite { if ( count( $refs ) == 0 ) { continue; } - $text .= "\n
"; 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
" . $this->error( 'cite_error_group_refs_without_references', htmlspecialchars( $group ) ); } } return true; diff --git a/citeParserTests.txt b/citeParserTests.txt index 4d872d870..329806b50 100644 --- a/citeParserTests.txt +++ b/citeParserTests.txt @@ -9,9 +9,11 @@ Simple , no !! input Wikipedia rocks!Proceeds of Rockology, vol. XXI !! result -

Wikipedia rocks![1] -
Cite error: <ref> tags exist, but no <references/> tag was found -

+Wikipedia rocks![1]
    +
  1. Proceeds of Rockology, vol. XXI +
  2. +
+ !! end !! test @@ -141,9 +143,11 @@ TemplatingText !! input {{REVISIONID}}elite !! result -

1337[1] -
Cite error: <ref> tags exist, but no <references/> tag was found -

+1337[1]
    +
  1. elite +
  2. +
+ !! end !! test diff --git a/i18n/core/en.json b/i18n/core/en.json index 37a7bc36a..c5aa5bec1 100644 --- a/i18n/core/en.json +++ b/i18n/core/en.json @@ -14,7 +14,6 @@ "cite_error_no_link_label_group": "Ran out of custom link labels for group \"$1\".\nDefine more in the [[MediaWiki:$2]] message.", "cite_error_references_no_text": "Invalid <ref> tag;\nno text was provided for refs named $1", "cite_error_included_ref": "Closing </ref> missing for <ref> tag", - "cite_error_refs_without_references": "<ref> tags exist, but no <references/> tag was found", "cite_error_group_refs_without_references": "<ref> tags exist for a group named \"$1\", but no corresponding <references group=\"$1\"/> tag was found, or a closing </ref> is missing", "cite_error_references_group_mismatch": "<ref> tag in <references> has conflicting group attribute \"$1\".", "cite_error_references_missing_group": "<ref> tag defined in <references> 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": "
    ", "cite_references_suffix": "
" -} \ No newline at end of file +}