Permalink
Browse files

[Nature Publishing] Don't detect on pdfs (#1605)

See #1599.
  • Loading branch information...
zuphilip committed Mar 27, 2018
1 parent 9fba327 commit c51821e26a97a1371730efdec17c80d83b0cef02
Showing with 4 additions and 4 deletions.
  1. +4 −4 Nature Publishing Group.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2018-02-03 18:26:58"
"lastUpdated": "2018-03-26 20:45:23"
}
/**
@@ -465,6 +465,7 @@ function isNature(url) {
}
function detectWeb(doc, url) {
if (url.endsWith('.pdf')) return false;
if (url.search(/\/(full|abs)\/[^\/]+($|\?|#)|\/fp\/.+?[?&]lang=ja(?:&|$)|\/articles\//) != -1) {
return 'journalArticle';
@@ -728,10 +729,9 @@ function doWeb(doc, url) {
//return false; //keep going so we can report this to zotero.org instead of "silently" failing
}
var items = {};
var title, url;
for (var i = 0; i < nodes.length; i++) {
title = Zotero.Utilities.xpathText(nodes[i], titlex, null, '');
link = Zotero.Utilities.xpath(nodes[i], linkx);
let title = Zotero.Utilities.xpathText(nodes[i], titlex, null, '');
let link = Zotero.Utilities.xpath(nodes[i], linkx);
if (title && link.length == 1) {
items[link[0].href] = title.trim();
}

0 comments on commit c51821e

Please sign in to comment.