* (bug 12239) Use different separators for autocomments
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 6 Feb 2008 11:45:38 +0000 (11:45 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 6 Feb 2008 11:45:38 +0000 (11:45 +0000)
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

RELEASE-NOTES
includes/Linker.php

index 9a4e501..a29619a 100644 (file)
@@ -157,6 +157,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   and installed when at the superuser level.
 * The default robot policy for the entire wiki is now configurable via the
   $wgDefaultRobotPolicy setting.
+* (bug 12239) Use different separators for autocomments
 
 === Bug fixes in 1.12 ===
 
index 7861a8f..11d3854 100644 (file)
@@ -973,8 +973,9 @@ class Linker {
         * add a separator where needed and format the comment itself with CSS
         * Called by Linker::formatComment.
         *
-        * @param $comment Comment text
-        * @param $title An optional title object used to links to sections
+        * @param string $comment Comment text
+        * @param object $title An optional title object used to links to sections
+        * @return string $comment formatted comment
         *
         * @todo Document the $local parameter.
         */
@@ -1002,14 +1003,17 @@ class Linker {
                                        $sectionTitle = wfClone( $title );
                                        $sectionTitle->mFragment = $section;
                                }
-                               $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
+                               $link = $this->makeKnownLinkObj( $sectionTitle, wfMsgForContent( 'sectionlink' ) );
                        }
-                       $sep='-';
-                       $auto=$link.$auto;
-                       if($pre) { $auto = $sep.' '.$auto; }
-                       if($post) { $auto .= ' '.$sep; }
-                       $auto='<span class="autocomment">'.$auto.'</span>';
-                       $comment=$pre.$auto.$post;
+                       $auto = $link . $auto;
+                       if( $pre ) {
+                               $auto = '- ' . $auto; # written summary $presep autocomment (summary /* section */)
+                       }
+                       if( $post ) {
+                               $auto .= ': '; # autocomment $postsep written summary (/* section */ summary)
+                       }
+                       $auto = '<span class="autocomment">' . $auto . '</span>';
+                       $comment = $pre . $auto . $post;
                }
 
                return $comment;