Skip to content

Commit 3e0f7d4

Browse files
Copilothainesr
andcommitted
Fix CI failures and address review feedback for hyphenated names
Co-authored-by: hainesr <143558+hainesr@users.noreply.github.com>
1 parent 10ac049 commit 3e0f7d4

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/cff/formatters/formatter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def self.select_and_check_model(model, preferred_citation)
4141
end
4242

4343
def self.initial_from_name_part(part)
44+
return part[0].capitalize unless part.include?('-')
45+
4446
part.split('-').filter_map { |sub| sub[0]&.capitalize }.join('.-')
4547
end
4648

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Kling, M.-U., & Picard, J.-L. (2021). Hyphenated names test [Computer software]
1+
Kling, M.-U., Picard, J.-L., & Smith, J. (2021). Hyphenated names test [Computer software]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@software{Kling_Hyphenated_names_test_2021,
2+
author = {Kling, Marc-Uwe and Picard, Jean-Luc and Smith, John},
3+
month = sep,
4+
title = {{Hyphenated names test}},
5+
year = {2021}
6+
}

test/files/formatter/hyphenated-names.cff

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ authors:
55
given-names: Marc-Uwe
66
- family-names: Picard
77
given-names: Jean-Luc
8+
- family-names: Smith
9+
given-names: John
810
title: Hyphenated names test
911
date-released: 2021-09-21

0 commit comments

Comments
 (0)