cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

Bad colorcode escaping #27

Closed txdv closed 13 years ago

txdv commented 13 years ago

The message was: [01:06:22] DEAD opa;): wh

The loggeroutput:

:six!~sixiukas@509AAD90.F7A8FA23.46EDDC6.IP PRIVMSG #six : DEAD 04opa;): wh

in the original message opa was colored red, so colorcode04, but it is not escaped.

dominikh commented 13 years ago

If you can suggest a sane way of escaping logger output, go ahead. I can't think of any unambiguous way.

txdv commented 13 years ago

Hm, what about just deleting it? If there is a the code color character, delete the trailing numbers? gsub(/a\d{2}(,\d{2}|)/, "") where a is the colorcode char?