diff --git a/Formatter/OutputFormatter.php b/Formatter/OutputFormatter.php index 600cf76f5..4e4d3dfd3 100644 --- a/Formatter/OutputFormatter.php +++ b/Formatter/OutputFormatter.php @@ -166,7 +166,7 @@ public function formatAndWrap(string $message, int $width) if (!$open && !$tag) { // $this->styleStack->pop(); - } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) { + } elseif (false === $style = $this->createStyleFromString($tag)) { $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); } elseif ($open) { $this->styleStack->push($style); @@ -210,15 +210,16 @@ private function createStyleFromString(string $string) $style = new OutputFormatterStyle(); foreach ($matches as $match) { array_shift($match); + $match[0] = strtolower($match[0]); if ('fg' == $match[0]) { - $style->setForeground($match[1]); + $style->setForeground(strtolower($match[1])); } elseif ('bg' == $match[0]) { - $style->setBackground($match[1]); + $style->setBackground(strtolower($match[1])); } elseif ('href' === $match[0]) { $style->setHref($match[1]); } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', $match[1], $options); + preg_match_all('([^,;]+)', strtolower($match[1]), $options); $options = array_shift($options); foreach ($options as $option) { $style->setOption($option);