Merge "Delete always true condition"
[lhc/web/wiklou.git] / includes / Linker.php
index b0ba43f..7eda21b 100644 (file)
@@ -1168,7 +1168,10 @@ class Linker {
                                                                $title->getDBkey(), $section );
                                                }
                                                if ( $sectionTitle ) {
-                                                       $link = Linker::makeCommentLink( $sectionTitle, $wgLang->getArrow(), $wikiId, 'noclasses' );
+                                                       $link = Linker::makeCommentLink(
+                                                               $sectionTitle, $wgLang->getArrow() . $auto, $wikiId, 'noclasses'
+                                                       );
+                                                       $auto = '';
                                                } else {
                                                        $link = '';
                                                }
@@ -1181,10 +1184,11 @@ class Linker {
                                                # autocomment $postsep written summary (/* section */ summary)
                                                $auto .= wfMessage( 'colon-separator' )->inContentLanguage()->escaped();
                                        }
-                                       $auto = '<span class="autocomment">' . $auto . '</span>';
-                                       $comment = $pre . $link . $wgLang->getDirMark()
-                                               . '<span dir="auto">' . $auto;
-                                       $append .= '</span>';
+                                       if ( $auto ) {
+                                               $auto = '<span dir="auto"><span class="autocomment">' . $auto . '</span>';
+                                               $append .= '</span>';
+                                       }
+                                       $comment = $pre . $link . $wgLang->getDirMark() . $auto;
                                }
                                return $comment;
                        },
@@ -1451,8 +1455,11 @@ class Linker {
                        $formatted = self::formatComment( $comment, $title, $local, $wikiId );
                        if ( $useParentheses ) {
                                $formatted = wfMessage( 'parentheses' )->rawParams( $formatted )->escaped();
+                               $classNames = 'comment';
+                       } else {
+                               $classNames = 'comment comment--without-parentheses';
                        }
-                       return " <span class=\"comment\">$formatted</span>";
+                       return " <span class=\"$classNames\">$formatted</span>";
                }
        }