@@ -354,8 +354,10 @@ function (FixerInterface $a, FixerInterface $b) {
354354 $ description = '[n/a] ' ;
355355 }
356356
357- $ description = wordwrap ($ description , 72 , "\n | " );
358- $ description = str_replace ('` ' , '`` ' , $ description );
357+ $ description = implode ("\n | " , self ::wordwrap (
358+ preg_replace ('/(`.+?`)/ ' , '<info>$1</info> ' , $ description ),
359+ 72
360+ ));
359361
360362 if (!empty ($ sets )) {
361363 $ help .= sprintf (" * <comment>%s</comment> [%s] \n | %s \n" , $ fixer ->getName (), implode (', ' , $ sets ), $ description );
@@ -366,7 +368,11 @@ function (FixerInterface $a, FixerInterface $b) {
366368 if ($ fixer ->isRisky ()) {
367369 $ help .= sprintf (
368370 " | *Risky rule: %s.* \n" ,
369- str_replace ('` ' , '`` ' , lcfirst (preg_replace ('/\.$/ ' , '' , $ fixer ->getDefinition ()->getRiskyDescription ())))
371+ preg_replace (
372+ '/(`.+?`)/ ' ,
373+ '<info>$1</info> ' ,
374+ lcfirst (preg_replace ('/\.$/ ' , '' , $ fixer ->getDefinition ()->getRiskyDescription ()))
375+ )
370376 );
371377 }
372378
@@ -399,7 +405,11 @@ function (FixerOptionInterface $optionA, FixerOptionInterface $optionB) {
399405 $ line .= ' (<comment> ' .implode ('</comment>, <comment> ' , $ allowed ).'</comment>) ' ;
400406 }
401407
402- $ line .= ': ' .str_replace ('` ' , '`` ' , lcfirst (preg_replace ('/\.$/ ' , '' , $ option ->getDescription ()))).'; ' ;
408+ $ line .= ': ' .preg_replace (
409+ '/(`.+?`)/ ' ,
410+ '<info>$1</info> ' ,
411+ lcfirst (preg_replace ('/\.$/ ' , '' , $ option ->getDescription ()))
412+ ).'; ' ;
403413 if ($ option ->hasDefault ()) {
404414 $ line .= 'defaults to <comment> ' .self ::toString ($ option ->getDefault ()).'</comment> ' ;
405415 } else {
@@ -420,7 +430,8 @@ function (FixerOptionInterface $optionA, FixerOptionInterface $optionB) {
420430 }
421431 }
422432
423- return $ help ;
433+ // prevent "\</foo>" from being rendered as an escaped literal style tag
434+ return preg_replace ('# \\\\(</.*?>)# ' , '<<$1 ' , $ help );
424435 }
425436
426437 /**
0 commit comments