mirror of
https://github.com/pestphp/pest.git
synced 2026-04-20 22:20:17 +02:00
release: v4.6.1
This commit is contained in:
@ -86,5 +86,12 @@ dataset('dataset_in_pest_file', ['A', 'B']);
|
||||
|
||||
function removeAnsiEscapeSequences(string $input): ?string
|
||||
{
|
||||
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input);
|
||||
return preg_replace(
|
||||
[
|
||||
'#\\x1b[[][^A-Za-z]*[A-Za-z]#', // CSI (colors, cursor, etc.)
|
||||
'#\\x1b\\]8;[^\\x1b\\x07]*(?:\\x1b\\\\|\\x07)#', // OSC 8 hyperlinks
|
||||
],
|
||||
'',
|
||||
$input,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user