Skip to content

Commit

Permalink
Fix box spacing with Symfony named style tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Mar 13, 2024
1 parent 73abd37 commit 7b4a362
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Themes/Default/Concerns/DrawsBoxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ protected function pad(string $text, int $length): string
*/
protected function stripEscapeSequences(string $text): string
{
// Strip ANSI escape sequences.
$text = preg_replace("/\e[^m]*m/", '', $text);

// Strip Symfony named style tags.
$text = preg_replace("/<(info|comment|question|error)>(.*?)<\/\\1>/", '$2', $text);

// Strip Symfony inline style tags.
return preg_replace("/<(?:(?:[fb]g|options)=[a-z,;]+)+>(.*?)<\/>/i", '$1', $text);
}
}

0 comments on commit 7b4a362

Please sign in to comment.