DiscordSRV

DiscordSRV

86.8k Downloads

Strip util striped not color words.

david50407 opened this issue ยท 1 comments

commented

In strip method ( src ), the string with ANSI color code will be strip.

But the regex rule is wrong, here's a fix:

\\[[0-9]{1,2};[0-9]{1,2};[0-9]{1,2}m
\\[[0-9]{1,3}m
[m

to

\e\\[[0-9]{1,2};[0-9]{1,2};[0-9]{1,2}m
\e\\[[0-9]{1,3}m
\e[m

Notice that leading \e (ANSI escape).

Without capturing \e, this method will strip [memo] to emo], but this is not color code.

commented

The text where [m would be stripped isn't part of an ANSI sequence