https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102970
Revision: 102970 Author: catrope Date: 2011-11-14 12:02:23 +0000 (Mon, 14 Nov 2011) Log Message: ----------- (bug 20050) References containing numbered lists cause Tidy to corrupt the references list. Patch by Brad Jorsch Modified Paths: -------------- trunk/extensions/Cite/Cite_body.php Modified: trunk/extensions/Cite/Cite_body.php =================================================================== --- trunk/extensions/Cite/Cite_body.php 2011-11-14 11:14:39 UTC (rev 102969) +++ trunk/extensions/Cite/Cite_body.php 2011-11-14 12:02:23 UTC (rev 102970) @@ -693,13 +693,13 @@ 'cite_references_link_one', $this->referencesKey( $key ), $this->refKey( $key ), - $val + rtrim( $val, "\n" ) . "\n" ); } elseif ( isset( $val['follow'] ) ) { return wfMsgForContentNoTrans( 'cite_references_no_link', $this->referencesKey( $val['follow'] ), - $val['text'] + rtrim( $val['text'], "\n" ) . "\n" ); } elseif ( $val['text'] == '' ) { return wfMsgForContentNoTrans( @@ -717,7 +717,7 @@ # $this->refKey( $val['key'], $val['count'] ), $this->refKey( $val['key'] ), - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) + ( $val['text'] != '' ? rtrim( $val['text'], "\n" ) . "\n" : $this->error( 'cite_error_references_no_text', $key ) ) ); // Standalone named reference, I want to format this like an // anonymous reference because displaying "1. 1.1 Ref text" is @@ -729,7 +729,7 @@ $this->referencesKey( $key . "-" . $val['key'] ), # $this->refKey( $key, $val['count'] ), $this->refKey( $key, $val['key'] . "-" . $val['count'] ), - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) + ( $val['text'] != '' ? rtrim( $val['text'], "\n" ) . "\n" : $this->error( 'cite_error_references_no_text', $key ) ) ); // Named references with >1 occurrences } else { @@ -749,7 +749,7 @@ return wfMsgForContentNoTrans( 'cite_references_link_many', $this->referencesKey( $key . "-" . $val['key'] ), $list, - ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) + ( $val['text'] != '' ? rtrim( $val['text'], "\n" ) . "\n" : $this->error( 'cite_error_references_no_text', $key ) ) ); } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs