doi must terminate in alphanumeric char

This commit is contained in:
Luke Smith 2022-10-07 16:38:19 -04:00
parent b8234faadb
commit 228cc6cfdb

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 - | grep -io "doi:\s*\S*" -m 1) ||
doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:\s*\S\+[[:alnum:]]" -m 1) ||
exit 1
else
doi="$1"