mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-03-28 17:43:05 +01:00
Fix flag emoji 'profile picture' rendering
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
frontend/dist/index.html
vendored
2
frontend/dist/index.html
vendored
@@ -13,7 +13,7 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<script type="module" crossorigin src="/assets/index-CEs7-vRv.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Cc-6GQU2.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-6X8xpvpN.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -13,6 +13,12 @@ describe('getAvatarText', () => {
|
||||
expect(getAvatarText('Test 😀 More 🎯', 'abc123')).toBe('😀');
|
||||
});
|
||||
|
||||
it('returns full flag emoji (not just first regional indicator)', () => {
|
||||
expect(getAvatarText('Jason 🇺🇸', 'abc123')).toBe('🇺🇸');
|
||||
expect(getAvatarText('🇬🇧 London', 'abc123')).toBe('🇬🇧');
|
||||
expect(getAvatarText('Test 🇯🇵 Japan', 'abc123')).toBe('🇯🇵');
|
||||
});
|
||||
|
||||
it('returns initials when name has space', () => {
|
||||
expect(getAvatarText('John Doe', 'abc123')).toBe('JD');
|
||||
expect(getAvatarText('Alice Bob Charlie', 'abc123')).toBe('AB');
|
||||
|
||||
@@ -28,8 +28,9 @@ function hashString(str: string): number {
|
||||
}
|
||||
|
||||
// Regex to match emoji (covers most common emoji ranges)
|
||||
// Flag emojis (e.g., 🇺🇸) are TWO consecutive regional indicator symbols, so we match those first
|
||||
const emojiRegex =
|
||||
/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;
|
||||
/[\u{1F1E0}-\u{1F1FF}]{2}|[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]/u;
|
||||
|
||||
/**
|
||||
* Extract display characters from a contact name.
|
||||
|
||||
Reference in New Issue
Block a user