ansi2irc: strip resets

This commit is contained in:
Gordon Shumway 2019-09-23 15:13:38 -04:00 committed by GitHub
parent 20435c7782
commit de16aae2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -673,10 +673,12 @@ class ASCII(callbacks.Plugin):
return ''
def ansi2irc(self, output):
output = output.replace('\x1b(B\x1b[m', '')
output = output.replace('\x1b(B\x1b[m', '')
output = output.replace('\x1b\x1b', '\x1b')
output = re.sub(r'\x1B\[[0-?]*[ -/]*[@-~]', lambda m: self.process_ansi(m.group(0)), output)
output = re.sub('\x0399,(\d\d)\x03(\d\d)', '\x03\g<2>,\g<1>', output)
output = output.replace('\x0F\x03', '\x03')
return output
def png(self, irc, msg, args, optlist, url):