summaryrefslogtreecommitdiff
path: root/biblio/bibtex
diff options
context:
space:
mode:
Diffstat (limited to 'biblio/bibtex')
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.12
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.dtx2
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.pdfbin347548 -> 347548 bytes
-rwxr-xr-xbiblio/bibtex/utils/bibcop/bibcop.pl15
4 files changed, 13 insertions, 6 deletions
diff --git a/biblio/bibtex/utils/bibcop/bibcop.1 b/biblio/bibtex/utils/bibcop/bibcop.1
index a925c67d1b..63c4e63688 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.1
+++ b/biblio/bibtex/utils/bibcop/bibcop.1
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2023-06-04"
+.TH bibcop 1 "2023-06-30"
.SH NAME
bibcop \- Style Checker and Fixer of BibTeX Files (.bib)
.SH SYNOPSIS
diff --git a/biblio/bibtex/utils/bibcop/bibcop.dtx b/biblio/bibtex/utils/bibcop/bibcop.dtx
index b152226fe7..11619f4b45 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.dtx
+++ b/biblio/bibtex/utils/bibcop/bibcop.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{bibcop}
%<*package>
-[2023-06-04 0.0.13 Style Checker of Bibliography Files]
+[2023-06-30 0.0.14 Style Checker of Bibliography Files]
%</package>
%<*driver>
\documentclass{ltxdoc}
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pdf b/biblio/bibtex/utils/bibcop/bibcop.pdf
index 091f5251a2..6228db525d 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.pdf
+++ b/biblio/bibtex/utils/bibcop/bibcop.pdf
Binary files differ
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pl b/biblio/bibtex/utils/bibcop/bibcop.pl
index 8deffac263..276d435dab 100755
--- a/biblio/bibtex/utils/bibcop/bibcop.pl
+++ b/biblio/bibtex/utils/bibcop/bibcop.pl
@@ -752,11 +752,18 @@ sub listed_tags {
return '(' . join(', ', @sorted) . ')';
}
+# Make sure the text can safely be rendered in TeX.
+sub escape_tex {
+ my ($tex) = @_;
+ $tex =~ s/[^a-zA-Z0-9-.,+)(:;@ '"]/?/g;
+ return $tex;
+}
+
# Print ERROR message to the console and die.
sub error {
my ($txt) = @_;
if (exists $args{'--latex'}) {
- print "\\PackageError{bibcop}{$txt}{}\n";
+ print "\\PackageError{bibcop}{" . escape_tex($txt). "}{}\n";
} else {
print STDERR $txt . "\n";
}
@@ -768,7 +775,7 @@ sub debug {
my ($txt) = @_;
if (exists $args{'--verbose'}) {
if (exists $args{'--latex'}) {
- print "\\message{bibcop: $txt^^J}\n";
+ print "\\message{bibcop: " . escape_tex($txt) . "^^J}\n";
} else {
print $txt . "\n";
}
@@ -788,7 +795,7 @@ sub info {
sub warning {
my ($txt) = @_;
if (exists $args{'--latex'}) {
- print "\\PackageWarningNoLine{bibcop}{$txt}\n";
+ print "\\PackageWarningNoLine{bibcop}{" . escape_tex($txt) . "}\n";
} else {
print $txt . "\n";
}
@@ -822,7 +829,7 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
" --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('0.0.13');
+ info('0.0.14');
} else {
my ($file) = grep { not($_ =~ /^--.*$/) } @ARGV;
if (not $file) {