mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 19:52:34 +01:00
Interpreter: do not dehighlight single-letter nicks or nicks in URLs
This commit is contained in:
parent
3c7ad2c529
commit
8e9742a0e4
@ -878,9 +878,10 @@ sub dehighlight_nicks {
|
||||
my @nicks = $self->{pbot}->{nicklist}->get_nicks($channel);
|
||||
return $line if not @nicks;
|
||||
foreach my $nick (@nicks) {
|
||||
next if length $nick == 1;
|
||||
$nick = quotemeta $nick;
|
||||
my $const_line = $line;
|
||||
while ($const_line =~ m/(?<![^\W_])($nick)(?![^\W_:])/gi) {
|
||||
while ($const_line =~ m/(?<![^\W_\.\\])($nick)(?![^\W_:])/gi) {
|
||||
my $match = $1;
|
||||
$match =~ s/^(.)/$1\x{200b}/;
|
||||
$line =~ s/$nick(?!:)/$match/i;
|
||||
|
Loading…
Reference in New Issue
Block a user