From 8f694424bd20f147a740b7329ffdf6c0cbcc53fc Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Thu, 22 Nov 2018 11:39:48 -0800 Subject: [PATCH] Differentiate comments with and without brackets 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 | 5 ++++- resources/src/mediawiki.special.changeslist.less | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index b0ba43fe68..0ecd744c9e 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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 " $formatted"; + return " $formatted"; } } diff --git a/resources/src/mediawiki.special.changeslist.less b/resources/src/mediawiki.special.changeslist.less index 67eece463f..c87a8a1499 100644 --- a/resources/src/mediawiki.special.changeslist.less +++ b/resources/src/mediawiki.special.changeslist.less @@ -67,7 +67,7 @@ content: '. .'; } -.comment, +.comment--without-parentheses, .mw-changeslist-links, .mw-diff-bytes, .mw-tag-markers, -- 2.20.1