We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0871dd4 + 4c0876f commit 75bac28Copy full SHA for 75bac28
1 file changed
src/TextFormatter.js
@@ -5,7 +5,7 @@ class TextFormatter {
5
* @type {RegExp}
6
* @private
7
*/
8
- static deformatRegex = /(\$[wnoitsgz><]|\$[lh]\[.+\]|\$[lh]|\$[0-9a-f]{1,3})/gi;
+ static deformatRegex = /\$((\$)|[0-9a-f]{2,3}|[lh]\[.*?\]|.)/gi;
9
10
/**
11
* Regex to match all the color formatting codes
@@ -27,7 +27,7 @@ class TextFormatter {
27
* @returns {string}
28
29
static deformat(input) {
30
- return input.replace(this.deformatRegex, "");
+ return input.replace(this.deformatRegex, "$2");
31
}
32
33
0 commit comments