3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

modules/trans.pl: use -no-ansi instead of regex

This commit is contained in:
Pragmatic Software 2021-01-19 02:23:10 -08:00
parent ba769dc446
commit f426594d80

5
modules/trans.pl vendored
View File

@ -14,11 +14,8 @@ my $args = quotemeta "@ARGV";
$args =~ s/\\([ :-])/$1/g;
$args =~ s/^\s+|\s+$//g;
my $opts = '-j';
my $opts = '-j -no-ansi -no-autocorrect';
$opts .= ' -b' unless $args =~ /^-/;
my $result = `trans $opts $args`;
$result =~ s/\e\[\d+m//g;
print "$result\n";