Skip to content

Commit d725691

Browse files
LanThuyNguyeniOvergaard
authored andcommitted
Fix issue support alternative characters in Avatar
1 parent 9fc5373 commit d725691

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/uui-avatar/lib/uui-avatar.element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export class UUIAvatarElement extends LitElement {
7171
return initials;
7272
}
7373

74-
const words = name.match(/(\w+)/g);
75-
74+
const matches = [...name.matchAll(/(?:^|\s)(.)/g)];
75+
const words = matches.map(m => m[1]).join('');
7676
if (!words?.length) {
7777
return initials;
7878
}

0 commit comments

Comments
 (0)