mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-17 09:29:30 +01:00
applets/pbot-vm: disregard IRC text modifiers when escaping unprintable characters
This commit is contained in:
parent
f2068a4baf
commit
4a025801a2
@ -373,12 +373,22 @@ sub postprocess_output($self) {
|
|||||||
# "\n" => '<nl>',
|
# "\n" => '<nl>',
|
||||||
|
|
||||||
# \t is left alone
|
# \t is left alone
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{output} =~ s/([\e\f])/$escapes{$1}/gs;
|
$self->{output} =~ s/([\e\f])/$escapes{$1}/gs;
|
||||||
|
|
||||||
# other unprintables
|
# other unprintables
|
||||||
my %disregard = ( "\n" => 1, "\r" => 1, "\t" => 1, "\x03" => 1 );
|
my %disregard = (
|
||||||
|
"\n" => 1, "\r" => 1, "\t" => 1,
|
||||||
|
"\x11" => 1, # monospace
|
||||||
|
"\x1D" => 1, # italic
|
||||||
|
"\x1E" => 1, # strikethrough
|
||||||
|
"\x1F" => 1, # underline
|
||||||
|
"\x02" => 1, # bold
|
||||||
|
"\x03" => 1, # colors
|
||||||
|
"\x0F" => 1, # reset
|
||||||
|
);
|
||||||
$self->{output} =~ s/([\x00-\x1f])/$disregard{$1} ? $1 : sprintf('\x%02X', ord $1)/gse;
|
$self->{output} =~ s/([\x00-\x1f])/$disregard{$1} ? $1 : sprintf('\x%02X', ord $1)/gse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4813,
|
BUILD_REVISION => 4814,
|
||||||
BUILD_DATE => "2024-10-25",
|
BUILD_DATE => "2024-10-27",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
Reference in New Issue
Block a user