diff --git a/bibcop.pl b/bibcop.pl index 682808e..dce3cc8 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -294,6 +294,7 @@ sub check_typography { my @no_space_after = ( '(', '[' ); my @space_before = ( '(', '[' ); my @space_after = ( ')', ']' ); + my @good_tails = ( 'Inc.', 'Ltd.' ); my @bad_tails = ( '.', ',', ';', ':', '-' ); foreach my $tag (keys %entry) { if ($tag =~ /^:.*/) { @@ -307,8 +308,16 @@ sub check_typography { if ($s eq '.' and $tag eq 'author') { next; } - if ($value =~ /^.*\Q$s\E$/) { - return "The '$tag' must not end with a $symbols{$s}" + my $good = 0; + foreach my $s (@good_tails) { + if ($value =~ /^.*\Q$s\E$/) { + $good = 1; + } + } + if (not $good) { + if ($value =~ /^.*\Q$s\E$/) { + return "The '$tag' must not end with a $symbols{$s}" + } } } foreach my $s (@no_space_before) { diff --git a/perl-tests/checks.pl b/perl-tests/checks.pl index bea400f..1467b76 100755 --- a/perl-tests/checks.pl +++ b/perl-tests/checks.pl @@ -68,6 +68,7 @@ package bibcop; check_passes($f, ('title' => 'Proper formatting of (brackets): with no space after it')); check_passes($f, ('title' => 'Proper formatting of (brackets); with no space after it')); check_passes($f, ('title' => 'Proper spaces in \(\phi\) and in $\phi$')); +check_passes($f, ('publisher' => 'Elsevier Science Inc.')); $f = 'check_wrapping'; check_fails($f, ('title' => 'The title is not surrounded by curled brackets'));