Merge 6e0377b5a1aa2ef5ebf2cb8e3d7730d09f4c2c7f into b8cd0ab4953d053fef09c48ba04f2fbb2df57aa4

This commit is contained in:
Emre AKYÜZ 2023-09-11 16:41:40 -06:00 committed by GitHub
commit 7bf7935311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
if [ -f "$1" ]; then
# Try to get DOI from pdfinfo or pdftotext output.
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
doi=$(pdftotext "$1" 2>/dev/null - | sed -n '/[dD][oO][iI]:/{s/.*[dD][oO][iI]:\s*\(\S\+[[:alnum:]]\).*/\1/p;q}') ||
doi=$(pdftotext "$1" 2>/dev/null - | sed -n -E 's/.*((DOI|doi)((\.(org))?\/?|:? *))([^: ]+[^ .]).*/doi:\6/p; T; q' ||
exit 1
else
doi="$1"