Gerrit Patch Uploader has uploaded a new change for review.
https://gerrit.wikimedia.org/r/129932
Change subject: Add reference list to section preview if missing
......................................................................
Add reference list to section preview if missing
For a section preview with missing references,
* Add a horizontal bar followed by ref lists for each group.
Bug: 5984
Change-Id: I2ca1b62fc068b20b7df4b0af2e3e79535e656259
---
M Cite_body.php
1 file changed, 17 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite
refs/changes/32/129932/1
diff --git a/Cite_body.php b/Cite_body.php
index 08c6072..b5e9bb6 100644
--- a/Cite_body.php
+++ b/Cite_body.php
@@ -1109,19 +1109,30 @@
return true;
}
- if ( $parser->getOptions()->getIsSectionPreview() ) {
- return true;
- }
-
+ $isSectionPreview =
$parser->getOptions()->getIsSectionPreview();
+ $alreadyFoundError = false;
foreach ( $this->mRefs as $group => $refs ) {
if ( count( $refs ) == 0 ) {
continue;
}
$text .= "\n<br />";
+ if ( $isSectionPreview && !$alreadyFoundError ) {
+ $text .= "<hr />";
+ }
+ $alreadyFoundError = true;
+
if ( $group == CITE_DEFAULT_GROUP ) {
- $text .= $this->error(
'cite_error_refs_without_references' );
+ if ( $isSectionPreview ) {
+ $text .= $this->parse("<references />");
+ } else {
+ $text .= $this->error(
'cite_error_refs_without_references' );
+ }
} else {
- $text .= $this->error(
'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
+ if ( $isSectionPreview ) {
+ $text .= $this->parse("<references
group='$group' />");
+ } else {
+ $text .= $this->error(
'cite_error_group_refs_without_references', htmlspecialchars( $group ) );
+ }
}
}
return true;
--
To view, visit https://gerrit.wikimedia.org/r/129932
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ca1b62fc068b20b7df4b0af2e3e79535e656259
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits