style(Authors): format as "First Last"#247
Merged
thewtex merged 2 commits intoInsightSoftwareConsortium:mainfrom Jan 19, 2026
Merged
style(Authors): format as "First Last"#247thewtex merged 2 commits intoInsightSoftwareConsortium:mainfrom
thewtex merged 2 commits intoInsightSoftwareConsortium:mainfrom
Conversation
Address InsightSoftwareConsortium#179 Updated the Authors.astro component with: Added capitalizeNamePart() helper - Ensures proper capitalization (first letter uppercase, rest lowercase) Added formatAuthorName() helper - Intelligently converts "Last, First" format to "First Last": - Detects the comma separator - Splits on comma - Reverses the order - Applies proper capitalization to each part - Falls back to simple capitalization for non-comma names - Updated getAuthorName() function - Now uses the new formatting logic for all name types: - Structured name objects (given/family) - String names - Literal name objects
✅ Deploy Preview for insightjournal ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
Author
|
@jhlegarreta what do you think of this: https://deploy-preview-247--insightjournal.netlify.app/browse/publication/301/ ? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Authors.astro component to improve author name formatting by adding intelligence to handle "Last, First" name format and ensure proper capitalization. The changes introduce helper functions to automatically convert comma-separated names and normalize capitalization across different name formats.
Changes:
- Added
capitalizeNamePart()helper to enforce consistent capitalization (first letter uppercase, rest lowercase) - Added
formatAuthorName()helper to intelligently convert "Last, First" format to "First Last" and apply proper capitalization - Updated
getAuthorName()to use new formatting logic for all name types (structured, string, and literal)
Comments suppressed due to low confidence (1)
src/components/Authors.astro:1
- The function checks for
namePartbut the parameter is namedname. This will cause a ReferenceError. ChangenameParttonamein both occurrences on line 30.
---
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The capitalizeNamePart() function unconditionally lowercases all characters after the first letter, which could incorrectly format names with special capitalization patterns such as 'McDonald', 'O'Brien', 'van der Waals', or 'McPherson'. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address #179
Updated the Authors.astro component with:
Added capitalizeNamePart() helper - Ensures proper capitalization (first letter uppercase, rest lowercase)
Added formatAuthorName() helper - Intelligently converts "Last, First" format to "First Last":
Detects the comma separator
Splits on comma
Reverses the order
Applies proper capitalization to each part
Falls back to simple capitalization for non-comma names
Updated getAuthorName() function - Now uses the new formatting logic for all name types:
Structured name objects (given/family)
String names
Literal name objects