Fix the mechanical style rules. [skip build]
This commit is contained in:
@@ -77,7 +77,7 @@ export function convertEmoticons(text: string): string {
|
||||
// e.g., :-) before :)
|
||||
const emoticons = Object.keys(EMOTICON_MAP).sort((a, b) => b.length - a.length);
|
||||
|
||||
for (const emoticon of emoticons) {
|
||||
emoticons.forEach((emoticon) => {
|
||||
// Escape special regex characters
|
||||
const escapedEmoticon = emoticon.replace(/[.*+?^${}()|[\]\\<>]/g, '\\$&');
|
||||
|
||||
@@ -93,7 +93,7 @@ export function convertEmoticons(text: string): string {
|
||||
// Otherwise convert to emoji
|
||||
return prefix + EMOTICON_MAP[emoticon];
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ export function convertEmoticonsInHtml(html: string): string {
|
||||
// Sort emoticons by length (longest first) to handle overlapping patterns
|
||||
const emoticons = Object.keys(EMOTICON_MAP).sort((a, b) => b.length - a.length);
|
||||
|
||||
for (const emoticon of emoticons) {
|
||||
emoticons.forEach((emoticon) => {
|
||||
// Convert emoticon to HTML entity version (for < and >)
|
||||
const htmlEmoticon = emoticon.replace(/</g, '<').replace(/>/g, '>');
|
||||
|
||||
@@ -130,7 +130,7 @@ export function convertEmoticonsInHtml(html: string): string {
|
||||
// Otherwise convert to emoji
|
||||
return prefix + EMOTICON_MAP[emoticon];
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user