Skip to content

Commit

Permalink
Merge pull request #21 from /issues/20/escape-colon
Browse files Browse the repository at this point in the history
Put identifier in quotes to escape colon
  • Loading branch information
yymao authored Feb 17, 2020
2 parents db8ff86 + 7f2bdbe commit 71bec71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adstex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
except ImportError:
from urllib import unquote

__version__ = "0.3.6"
__version__ = "0.3.7"

_this_year = date.today().year % 100
_this_cent = date.today().year // 100
Expand Down Expand Up @@ -159,7 +159,7 @@ def id2bibcode(id_this, possible_id_types=("bibcode", "doi", "arxiv")):
for id_type in possible_id_types:
m = _re_id[id_type].search(id_this)
if m:
s = fixedAdsSearchQuery(q="identifier:{}".format(m.group()), fl=["bibcode"])
s = fixedAdsSearchQuery(q="identifier:\"{}\"".format(m.group()), fl=["bibcode"])
try:
return next(s).bibcode
except StopIteration:
Expand Down

0 comments on commit 71bec71

Please sign in to comment.