Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Nov 25, 2024
1 parent 0996484 commit 9da6f9a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions RIS.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"inRepository": true,
"translatorType": 3,
"lastUpdated": "2024-11-25 17:28:41"
"lastUpdated": "2024-11-25 18:57:30"
}

/*
Expand Down Expand Up @@ -1770,20 +1770,18 @@ function completeItem(item) {
if (cleanDOI) item.DOI = cleanDOI;
}

// Use the shorter journal abbreviation, and move the longer one to
// publicationTitle if not yet set
if (item.backupJournalAbbreviation) {
if (item.backupJournalAbbreviation.length < item.journalAbbreviation.length) {
if (!item.publicationTitle) {
item.publicationTitle = item.journalAbbreviation;
}
// If we have a journalAbbreviation, use it to fill publicationTitle if missing
if (item.journalAbbreviation) {
if (!item.publicationTitle) {
item.publicationTitle = item.journalAbbreviation;
}
// If we got multiple potential journalAbbreviations, keep the longest one
if (item.backupJournalAbbreviation
&& item.backupJournalAbbreviation.length < item.journalAbbreviation.length) {
item.journalAbbreviation = item.backupJournalAbbreviation;
}
delete item.backupJournalAbbreviation;
}
else if (item.journalAbbreviation && !item.publicationTitle) {
item.publicationTitle = item.journalAbbreviation;
}

// Hack for Endnote exports missing full title
if (item.shortTitle && !item.title) {
Expand Down

0 comments on commit 9da6f9a

Please sign in to comment.