From: jdlrobson Date: Thu, 22 Nov 2018 19:39:48 +0000 (-0800) Subject: Differentiate comments with and without brackets X-Git-Tag: 1.34.0-rc.0~3459^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/Template:Foo?a=commitdiff_plain;h=8f694424bd20f147a740b7329ffdf6c0cbcc53fc;p=lhc%2Fweb%2Fwiklou.git 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 --- 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,