mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-26 06:57:04 +01:00
Consider spacing when converting string to unicode emote
This commit is contained in:
parent
6c48efb6c6
commit
44ff83ef17
@ -1878,8 +1878,9 @@
|
|||||||
};
|
};
|
||||||
for (var i in map) {
|
for (var i in map) {
|
||||||
var escaped = i.replace(/([()[{*+.$^\\|?])/g, '\\$1');
|
var escaped = i.replace(/([()[{*+.$^\\|?])/g, '\\$1');
|
||||||
|
escaped = "(\\s|^)(" + escaped + ")(\\s|$)";
|
||||||
var regex = new RegExp(escaped, 'gim');
|
var regex = new RegExp(escaped, 'gim');
|
||||||
input = input.replace(regex, map[i]);
|
input = input.replace(regex, "$1" + map[i] + "$3");
|
||||||
}
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user