Clean monospace and strikethrough formatters
This commit is contained in:
parent
7bbd3d61d5
commit
b391b87e29
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
const matchFormatting = /\x02|\x1D|\x1F|\x16|\x0F|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
|
||||
const matchFormatting = /\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;
|
||||
|
||||
module.exports = (message) => message.replace(matchFormatting, "").trim();
|
||||
|
@ -23,6 +23,15 @@ describe("cleanIrcMessage", function() {
|
||||
}, {
|
||||
input: "\x1ditalic",
|
||||
expected: "italic",
|
||||
}, {
|
||||
input: "\x1estrikethrough",
|
||||
expected: "strikethrough",
|
||||
}, {
|
||||
input: "\x11monospace",
|
||||
expected: "monospace",
|
||||
}, {
|
||||
input: "\x16reset color",
|
||||
expected: "reset color",
|
||||
}, {
|
||||
input: "\x1funderline",
|
||||
expected: "underline",
|
||||
|
Loading…
Reference in New Issue
Block a user