Can't compile translators with Google Closure compiler because string line continuations

177 views
Skip to first unread message

Lennart Borgman

unread,
Jun 30, 2015, 11:55:31 AM6/30/15
to zoter...@googlegroups.com
When trying to compile code from the translators I get this error from the Closure compiler:

trans/translators-idx.js:1357: WARNING - Parse error. String continuations are not recommended. See https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml#Multiline_string_literals
ZU.xpath(doc, '//form[contains(@id, "Search")]\

The code looks like this:

ZU.xpath(doc, '//form[contains(@id, "Search")]\
//a[contains(@href, "abstract") or contains(@href, "fulltext")]') ) {

How can I change the string to one line?

Aurimas Vinckevicius

unread,
Jun 30, 2015, 12:00:32 PM6/30/15
to zoter...@googlegroups.com
replace /\\\n\s+/ with "' + '" (note that it's single quote inside double quote). I think we generally use single quote for xpaths, but that's not really guaranteed.

Idk if we mentioned this before, but you're aware of Proquest's PME, right? https://github.com/proquest/pme

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at http://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

Lennart Borgman

unread,
Jun 30, 2015, 12:26:05 PM6/30/15
to zoter...@googlegroups.com
Ah, thanks Aurimas. I thought I had to be good on xpath... ;-)

No, or at least I do not remember having seen PME. So they are also building a bookmarklet? Now we have the original Zotero bookmarklet, my (quick) rewrite of that to allow saving to groups, (soon, I hope) my new one and PME.

I guess PME has another focus. I will have a look at it.
Reply all
Reply to author
Forward
0 new messages