Rewrite the restricted iterators and reorder the forward references. [skip build]
This commit is contained in:
@@ -143,7 +143,8 @@ export function convertEmoticonsInHtml(html: string): string {
|
||||
export function containsEmoticons(text: string): boolean {
|
||||
const emoticons = Object.keys(EMOTICON_MAP);
|
||||
|
||||
for (const emoticon of emoticons) {
|
||||
for (let i = 0; i < emoticons.length; i += 1) {
|
||||
const emoticon = emoticons[i];
|
||||
const escapedEmoticon = emoticon.replace(/[.*+?^${}()|[\]\\<>]/g, '\\$&');
|
||||
const regex = new RegExp(`(^|\\s)(${escapedEmoticon})(?=\\s|$)`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user