Skip to content

Commit

Permalink
Make the AuthorInitials function more i18n-friendly
Browse files Browse the repository at this point in the history
I believe this should fix bug 1444986, where the initial "Á" of Emilio's last name is being ignored, so that treeherder displays the incorrect initials "EL" instead of "EÁ".
  • Loading branch information
jfkthame authored and Archaeopteryx committed Nov 20, 2023
1 parent e641af6 commit 3ea88f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/shared/Revision.jsx
Expand Up @@ -13,7 +13,7 @@ export function AuthorInitials(props) {
const str = props.author || '';
const words = str.split(' ');
const firstLetters = words
.map((word) => word.replace(/[^A-Z]/gi, '')[0])
.map((word) => word.replace(/\P{General_Category=Letter}/gu, '')[0])
.filter((firstLetter) => typeof firstLetter !== 'undefined');
let initials = '';

Expand Down

0 comments on commit 3ea88f6

Please sign in to comment.