thelounge/client/js/helpers/ircmessageparser/cleanIrcMessage.ts

6 lines
267 B
TypeScript
Raw Normal View History

2022-02-10 00:27:34 +01:00
const matchFormatting =
2022-05-15 00:18:06 +02:00
// eslint-disable-next-line no-control-regex
2022-02-10 00:27:34 +01:00
/\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
2017-11-22 15:06:32 +01:00
export default (message: string) => message.replace(matchFormatting, "").trim();