[Console] Undecorated formatter must update style stack too.
This commit is contained in:
parent
bd7e01a858
commit
90a2a6e556
@ -147,15 +147,11 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
*/
|
||||
private function replaceStyle($match)
|
||||
{
|
||||
if (!$this->isDecorated()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Special "</>" tag resets all styles.
|
||||
if (!isset($match[2])) {
|
||||
$this->styleStack->reset();
|
||||
|
||||
return "\033[0m";
|
||||
return $this->isDecorated() ? "\033[0m" : '';
|
||||
}
|
||||
|
||||
if (isset($this->styles[strtolower($match[2])])) {
|
||||
@ -174,7 +170,7 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
$this->styleStack->pushStyle($style);
|
||||
}
|
||||
|
||||
return $this->styleStack->getCurrentStyle()->getTerminalSequence();
|
||||
return $this->isDecorated() ? $this->styleStack->getCurrentStyle()->getTerminalSequence() : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user