mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-11-04 08:37:24 +01:00 
			
		
		
		
	modules/trans.pl: use -no-ansi instead of regex
This commit is contained in:
		
							parent
							
								
									ba769dc446
								
							
						
					
					
						commit
						f426594d80
					
				
							
								
								
									
										5
									
								
								modules/trans.pl
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								modules/trans.pl
									
									
									
									
										vendored
									
									
								
							@ -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";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user