mirror of
https://github.com/zotero/zotero.git
synced 2026-10-06 02:50:03 +00:00
Trans: Fix book section issue with CSA, per http://forums.zotero.org/discussion/18389
This commit is contained in:
parent
47dbd613ea
commit
65bd289910
1 changed files with 8 additions and 3 deletions
|
|
@ -8,7 +8,7 @@
|
|||
"maxVersion":"",
|
||||
"priority":100,
|
||||
"inRepository":true,
|
||||
"lastUpdated":"2011-01-11 04:31:00"
|
||||
"lastUpdated":"2011-06-14 04:31:00"
|
||||
}
|
||||
|
||||
/* Provides support for databases of Cambridge Scientific Abstracts
|
||||
|
|
@ -120,7 +120,8 @@ function scrape(doc) {
|
|||
newItem.publisher = m[2];
|
||||
}
|
||||
} else if(itemType == "bookSection") {
|
||||
if((content.length > newItem.publicationTitle.length
|
||||
var untitled = !newItem.publicationTitle;
|
||||
if(untitled || (content.length > newItem.publicationTitle.length
|
||||
&& content.substr(0, newItem.publicationTitle.length) == newItem.publicationTitle)
|
||||
|| content.indexOf(newItem.publicationTitle)) {
|
||||
if (content.indexOf(newItem.publicationTitle) > 4) {
|
||||
|
|
@ -131,10 +132,14 @@ function scrape(doc) {
|
|||
}
|
||||
var m = content.match(/\)\. ([^:()]+): ([^,0-9]+)/);
|
||||
if(m) {
|
||||
if (untitled) {
|
||||
var n = content.match(/\([0-9]{4}\)([^(]*)/);
|
||||
if (n) newItem.publicationTitle = n[1];
|
||||
}
|
||||
newItem.place = m[1];
|
||||
newItem.publisher = m[2];
|
||||
}
|
||||
var m = content.match(/\(pp. ([\-0-9]+)\)/);
|
||||
m = content.match(/\(pp. ([\-0-9]+)\)/);
|
||||
if(m) newItem.pages = m[1];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue