Unable to add record - translator issue?
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
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
[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.