Trans: Fixing abstract handling for JSTOR and SSRN, per http://forums.zotero.org/discussion/18599/
This commit is contained in:
parent
f6c56b6b1f
commit
18bd1855dc
|
@ -124,7 +124,7 @@ function doWeb(doc, url) {
|
||||||
if(item.notes && item.notes[0]) {
|
if(item.notes && item.notes[0]) {
|
||||||
// For some reason JSTOR exports abstract with 'AB' tag istead of 'N1'
|
// For some reason JSTOR exports abstract with 'AB' tag istead of 'N1'
|
||||||
item.abstractNote = item.notes[0].note;
|
item.abstractNote = item.notes[0].note;
|
||||||
item.abstractNote = item.abstractNote.replace(/^<p>ABSTRACT /,'').replace(/<\/p>$/,'');
|
item.abstractNote = item.abstractNote.replace(/^<p>(ABSTRACT )?/,'').replace(/<\/p>$/,'');
|
||||||
delete item.notes;
|
delete item.notes;
|
||||||
item.notes = undefined;
|
item.notes = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"maxVersion":"",
|
"maxVersion":"",
|
||||||
"priority":100,
|
"priority":100,
|
||||||
"inRepository":true,
|
"inRepository":true,
|
||||||
"lastUpdated":"2009-01-28 18:10:00"
|
"lastUpdated":"2011-07-01 18:10:00"
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectWeb(doc, url) {
|
function detectWeb(doc, url) {
|
||||||
|
@ -83,7 +83,7 @@ function doWeb(doc, url) {
|
||||||
var aut = Zotero.Utilities.capitalizeTitle(Zotero.Utilities.trimInternal(author.textContent));
|
var aut = Zotero.Utilities.capitalizeTitle(Zotero.Utilities.trimInternal(author.textContent));
|
||||||
item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author"));
|
item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author"));
|
||||||
}
|
}
|
||||||
item.abstractNote = Zotero.Utilities.trimInternal(doc.evaluate('//div[@id="innerWhite"]/font[1]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent).substr(10);
|
item.abstractNote = Zotero.Utilities.trimInternal(doc.evaluate('//div[@id="innerWhite"]/font[1]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent).replace(/^abstract/i,'');
|
||||||
var tags = doc.evaluate('//font[contains(./b/text(), "Key")]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
|
var tags = doc.evaluate('//font[contains(./b/text(), "Key")]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
|
||||||
if (tags) {
|
if (tags) {
|
||||||
item.tags = Zotero.Utilities.trimInternal(tags.textContent).substr(10).split(/,\s+/);
|
item.tags = Zotero.Utilities.trimInternal(tags.textContent).substr(10).split(/,\s+/);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user