Skip to content

Commit

Permalink
Merge pull request zotero#786 from zotero/sjk/ovid
Browse files Browse the repository at this point in the history
Don't use XRegExp for Ovid Tagged
  • Loading branch information
simonster committed Oct 14, 2014
2 parents 0538970 + c4f20cd commit aac22d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OVID Tagged.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"inRepository": true,
"translatorType": 1,
"browserSupport": "gcs",
"lastUpdated": "2014-02-10 19:08:44"
"lastUpdated": "2014-10-12 22:00:27"
}

/*
Expand Down Expand Up @@ -197,14 +197,14 @@ function finalizeItem(item) {
delete item.creatorsBackup;
if (!item.itemType) item.itemType = inputTypeMap["Journal Article"];
item.title = item.title.replace(/(\.\s*)?(\[(Article|Report|Miscellaneous)\])?$/, "")
var monthRegex = new ZU.XRegExp('([-/]?(Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?))+', 'n');
var monthRegex = /(?:[-/]?(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?))+/;
var value = item.citation
if (!value && item.itemType == "bookSection") value = item.bookTitle
if (item.itemType == "journalArticle" && value) {
if (value.match(/\d{4}/)) {
if (!item.date) item.date = value.match(/\d{4}/)[0];
}
var month = ZU.XRegExp.exec(value, monthRegex);
var month = monthRegex.exec(value);
if (month) item.date = item.date += " " + (month)[0];
if (value.match(/(\d+)\((\d+(?:\-\d+)?)\)/)) {
var voliss = value.match(/(\d+)\((\d+(?:\-\d+)?)\)/);
Expand Down

0 comments on commit aac22d9

Please sign in to comment.