Skip to content

Commit

Permalink
fix: skip abbreviator if journal title is already abbreviated (#36)
Browse files Browse the repository at this point in the history
See pierre-24/pyiso4#11
Example: 10.1021/acs.jpcc.3c05522

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Jun 30, 2024
1 parent 1fea2cb commit 7bbce67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wenxian/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def journal_abbr(self) -> str | None:
if self.journal == "arXiv":
# special case
return "arXiv"
if "." in self.journal.title():
# assume it is already abbreviated, cannot handle cases like "J. Chem. Phys."
# https://github.com/pierre-24/pyiso4/issues/11
# Example: 10.1021/acs.jpcc.3c05522
return self.journal.title()
return abbreviator(self.journal.title(), remove_part=True)

@property
Expand Down

0 comments on commit 7bbce67

Please sign in to comment.