From 6085220bfcadecd4def6a22a7a7ede6eeeaf245a Mon Sep 17 00:00:00 2001 From: Shahab Date: Sat, 9 Apr 2022 14:12:32 +0430 Subject: [PATCH] fix(avatar): add ZWNJ between initials of letter avatars --- react/features/base/avatar/functions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react/features/base/avatar/functions.js b/react/features/base/avatar/functions.js index 9c4099589..68677a667 100644 --- a/react/features/base/avatar/functions.js +++ b/react/features/base/avatar/functions.js @@ -68,7 +68,9 @@ export function getInitials(s: ?string) { const initialsBasis = _.split(s, '@')[0]; const [ firstWord, secondWord ] = initialsBasis.split(wordSplitRegex).filter(Boolean); - return getFirstGraphemeUpper(firstWord) + getFirstGraphemeUpper(secondWord); + // Add ZWNJ to separate the initials in languages like Arabic or Persian. + return `${getFirstGraphemeUpper(firstWord)}\u200c${getFirstGraphemeUpper(secondWord)}`; + } /**