Differentiate comments with and without brackets
authorjdlrobson <jdlrobson@gmail.com>
Thu, 22 Nov 2018 19:39:48 +0000 (11:39 -0800)
committerjdlrobson <jdlrobson@gmail.com>
Thu, 22 Nov 2018 19:46:37 +0000 (11:46 -0800)
Per T205581#4768548 cached HTML might render a comment with
double brackets in the text. The CSS selector should not apply
there so a new class is used.

Using a BEM convention for the time being. This class can be
removed in future if needed.

Bug: T205581
Change-Id: If1552d6ddd4729b8beca45a1ca19ec6ce36e6118

includes/Linker.php
resources/src/mediawiki.special.changeslist.less

index b0ba43f..0ecd744 100644 (file)
@@ -1451,8 +1451,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>";
                }
        }
 
index 67eece4..c87a8a1 100644 (file)
@@ -67,7 +67,7 @@
        content: '. .';
 }
 
-.comment,
+.comment--without-parentheses,
 .mw-changeslist-links,
 .mw-diff-bytes,
 .mw-tag-markers,