I tried to add this article to my database but I got an error message about "translators": http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0012968
It is a problem, but I'm having trouble nailing it down. There's something about the RIS output the PLoS is giving us that makes the translator choke. I've set it aside for now. Do other PLoS pages work for you?
No, there should always be a double space. Single spaces are a violation of the RIS spec, although we allow them now, since many programs violate it in precisely this way.
In an effort to redeem myself (I actually have the T-shirt, and I'd like to keep it), I found the problem. The line
text = text.replace(text.match(/(ER[^\n]*)([^\0]*)/)[2],""); matches the "ER" in the paper title ("MEK/ERK Cell Signaling Pathway"), which messes things up. I'm not sure it's the best solution, but
text = text.replace(text.match(/(\nER[^\n]*)([^\0]*)/)[2],""); works (the RegEx now requires a linefeed before the "ER").
Thanks, Rintze. I've opted for: text = text.replace(text.match(/(^\s*ER[^\n]*)([^\0]*)/m)[2],""); It accomplishes the same thing, but will work on \r-delimited lines as well (note the m flag to make the match work in multiline mode).
[JavaScript Error: "TypeError: text.match(/UR\s+\-\s+(.*)/) is null" {file: "file:///C:/Users/Lexi/AppData/Roaming/Mozilla/Firefox/Profiles/2orbmq3e.Sebastian/zotero/translators/PLoS%20Journals.js" line: 0}]
UR - http://dx.doi.org/10.1371%2Fjournal.pone.0012968
The RegEx only expects there to be one after "UR", right? I think "/UR\s*\-\s+(.*)/" should work.
http://store.xkcd.com/xkcd/#RegularExpressionsShirt
text = text.replace(text.match(/(ER[^\n]*)([^\0]*)/)[2],"");
matches the "ER" in the paper title ("MEK/ERK Cell Signaling Pathway"), which messes things up. I'm not sure it's the best solution, but
text = text.replace(text.match(/(\nER[^\n]*)([^\0]*)/)[2],"");
works (the RegEx now requires a linefeed before the "ER").
text = text.replace(text.match(/(^\s*ER[^\n]*)([^\0]*)/m)[2],"");
It accomplishes the same thing, but will work on
\r
-delimited lines as well (note them
flag to make the match work in multiline mode).Please go to http://github.com/ajlyon/zotero-bits/raw/master/PLoS Journals.js and save the file to the translators directory of your Zotero data directory (http://www.zotero.org/support/zotero_data).
It should start working again. If this works for you, please post here so that I can submit this change to be pushed to all users.