r30611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30610‎ | r30611 | r30612 >
Date:11:45, 6 February 2008
Author:raymond
Status:old
Tags:
Comment:
* (bug 12239) Use different separators for autocomments
This avoids confusion if there was some text deleted (which is often marked as "- foobar" by contributors) or a normal comment.
Based on a patch of Danny B
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -973,8 +973,9 @@
974974 * add a separator where needed and format the comment itself with CSS
975975 * Called by Linker::formatComment.
976976 *
977 - * @param $comment Comment text
978 - * @param $title An optional title object used to links to sections
 977+ * @param string $comment Comment text
 978+ * @param object $title An optional title object used to links to sections
 979+ * @return string $comment formatted comment
979980 *
980981 * @todo Document the $local parameter.
981982 */
@@ -1002,14 +1003,17 @@
10031004 $sectionTitle = wfClone( $title );
10041005 $sectionTitle->mFragment = $section;
10051006 }
1006 - $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
 1007+ $link = $this->makeKnownLinkObj( $sectionTitle, wfMsgForContent( 'sectionlink' ) );
10071008 }
1008 - $sep='-';
1009 - $auto=$link.$auto;
1010 - if($pre) { $auto = $sep.' '.$auto; }
1011 - if($post) { $auto .= ' '.$sep; }
1012 - $auto='<span class="autocomment">'.$auto.'</span>';
1013 - $comment=$pre.$auto.$post;
 1009+ $auto = $link . $auto;
 1010+ if( $pre ) {
 1011+ $auto = '- ' . $auto; # written summary $presep autocomment (summary /* section */)
 1012+ }
 1013+ if( $post ) {
 1014+ $auto .= ': '; # autocomment $postsep written summary (/* section */ summary)
 1015+ }
 1016+ $auto = '<span class="autocomment">' . $auto . '</span>';
 1017+ $comment = $pre . $auto . $post;
10141018 }
10151019
10161020 return $comment;
Index: trunk/phase3/RELEASE-NOTES
@@ -157,6 +157,7 @@
158158 and installed when at the superuser level.
159159 * The default robot policy for the entire wiki is now configurable via the
160160 $wgDefaultRobotPolicy setting.
 161+* (bug 12239) Use different separators for autocomments
161162
162163 === Bug fixes in 1.12 ===
163164

Status & tagging log