From a81108bdb8e6c45d62a0e53488c078eeda74767b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 28 May 2018 22:28:57 +0000 Subject: crossrefware (28may18) git-svn-id: svn://tug.org/texlive/trunk@47861 c570f23f-e606-0410-a88d-b1316a301751 --- .../texlive/linked_scripts/crossrefware/bbl2bib.pl | 21 ++++++++++++++++++++- .../linked_scripts/crossrefware/bibzbladd.pl | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl index 3f66a6f061b..397e52a6af8 100755 --- a/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl +++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl @@ -172,7 +172,7 @@ while (<$input>) { /\\begin\{thebibliography\}/ || /\\end\{thebibliography\}/) { next; } - if (/\\bibitem(\[[^\]]*\])?\{([^\}]*)\}/) { + if (/\\bibitem\s*(\[[^\]]*\])?\{([^\}]*)\}/) { ProcessBibitem($bibitem); $bibitem = undef; $bibitem->{key}=$2; @@ -266,6 +266,13 @@ sub SearchMref { } if ($response =~ /
(.*)<\/pre>/s) {
 	my $bib= $1;
+	# Looks like Mathscinet sometimes fails to unaccent text.  
+	# For the time being we just delete the offending characters.
+	# Should probably write LaTeX::FromUnicode instead
+	$bib =~ s/[^\x00-\x7f]//g;
+	if ($debug) {
+	    print STDOUT "DEBUG: got $bib\n";
+	}
 	my $fh = new FileHandle;
 	open $fh, "<", \$bib;
 	my $parser = new BibTeX::Parser($fh);
@@ -273,6 +280,18 @@ sub SearchMref {
 	if (ref($entry) && $entry->parse_ok()) {
 	    $entry->key($bibitem->{key});
 	    return ($entry);
+	} else {
+	    if ($debug) {
+		if (!ref($entry)) {
+		    print STDERR "DEBUG: not a reference\n";
+		} else{
+		    print STDERR "DEBUG: parsing $entry->parse_ok\n";
+		}
+	    }
+	}
+    } else {
+	if ($debug) {
+	    print STDOUT "DEBUG: did not get an entry\n";
 	}
     }
 }
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
index 2dba99eeedc..7516862bafe 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
@@ -189,7 +189,7 @@ sub GetZbl {
 	$response->decoded_content, "\n";
     }
     
-    if ($response->decoded_content =~ /^\s*"zbl_id":\s*"(.*)",\s*$/m) {
+    if ($response->decoded_content =~ /^\s*"zbl_id":\s*"(.*)",?\s*$/m) {
 	if ($debug) {
 	    print STDERR "DEBUG:  got zbl: $1\n",
 	}
-- 
cgit v1.2.3