Skip to content

Commit

Permalink
Merge pull request #577 from NASA-IMPACT/fix/827-remove-extra-commas
Browse files Browse the repository at this point in the history
adds support for multiple initials in author names
  • Loading branch information
wrynearson authored Mar 18, 2024
2 parents 4d4ce68 + c5b7e71 commit f214d90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/assets/scripts/utils/references.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ function formatAuthors(authors, type = 'reference') {
const firstNameInitialed = firstName
.trim()
.split(' ')
.map((word) => `${word[0]}.`); // first letter
.map((word) => `${word[0]}.`) // add period after first letter
.join(''); // rejoin in case of multiple initials
return `${lastName}, ${firstNameInitialed}`;
});

Expand Down

0 comments on commit f214d90

Please sign in to comment.