Fix the mechanical style rules. [skip build]

This commit is contained in:
2026-11-01 09:01:32 +11:00
parent 831ce01150
commit 9591d8d01b
42 changed files with 762 additions and 756 deletions
+4 -4
View File
@@ -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, '&lt;').replace(/>/g, '&gt;');
@@ -130,7 +130,7 @@ export function convertEmoticonsInHtml(html: string): string {
// Otherwise convert to emoji
return prefix + EMOTICON_MAP[emoticon];
});
}
});
return result;
}