Skip to content

Commit

Permalink
Deploying to gh-pages from @ 80866da 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 3, 2024
1 parent 1c33483 commit 38e95e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions bibcop.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# 2024-05-03 03.13.18
# 2024-05-03 03.36.48
package bibcop;

use warnings;
Expand Down Expand Up @@ -659,26 +659,28 @@ sub fix_capitalization {
if (not $word =~ /^[A-Za-z]/) {
next;
}
my $lc = lc($word);
if (exists $minors{$lc} and $pos > 1) {
my $start = 1;
if ($pos > 1) {
my $before = $words[$pos - 2];
if (not $before =~ /(:|\?|!|;)$/) {
$word = $lc;
next;
if (not $before =~ /(:|\?|!|;|-)$/) {
$start = 0;
}
}
if ($word =~ /^[a-z].*/) {
$word =~ s/^([a-z])/\U$1/g;
}
my @parts = split(/-/, $word, -1);
my $p = 0;
foreach my $part (@parts) {
$p += 1;
if (exists $minors{lc($part)}) {
my $lcp = lc($part);
if (exists $minors{$lcp}) {
if ($p > 1) {
my $pre = $parts[$p - 2];
if (not $pre eq '') {
$part = lc($part);
$part = $lcp;
next;
}
} elsif (@parts+0 == 1) {
if (not $start) {
$part = $lcp;
next;
}
}
Expand Down Expand Up @@ -1070,7 +1072,7 @@ sub fail {
" --latex Report errors in LaTeX format using \\PackageWarningNoLine command\n\n" .
"If any issues, report to GitHub: https://github.com/yegor256/bibcop");
} elsif (exists $args{'--version'} or exists $args{'-v'}) {
info('03.13.18 2024-05-03');
info('03.36.48 2024-05-03');
} else {
my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
if (not $file) {
Expand Down
2 changes: 1 addition & 1 deletion bibcop.sty
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bibcop}
[2024-05-03 03.13.18 Style Checker of Bibliography Files]
[2024-05-03 03.36.48 Style Checker of Bibliography Files]



Expand Down

0 comments on commit 38e95e4

Please sign in to comment.