References stuck in code

edited November 10, 2020
Hello,

When I try switch from American Sociological Association citations to APA (or other citations) in chrome my document updates but the references are stuck in code, like this:

<div class="csl-bib-body">
<div class="csl-entry">Berger, P. L. (1990). <i>The sacred canopy: Elements of a sociological theory of religion</i>. New York, NY: Books.</div>


I've tried refreshing and redoing but can't get it to work. What can I do? Any tips?
  • The forum interprets that as HTML, but I assume you mean that it's showing the raw HTML? Where are you seeing this? Is this in a word processor with the Zotero plugin, in ZoteroBib, something else?
  • Oy yes you are right! If only it would convert when it is supposed to. Yes it is stuck in the raw HTML in google docs (chrome with zotero plug on). HTML conversion works perfectly for ASA but not other styles
  • I don't recall seeing that before in Google Docs, but @adomasven may have some ideas.
  • Thank you! Otherwise now that I know it's stuck in raw HTML maybe I can try to find some HTML converters? That's a bit if a hassle tho and I hope we can figure it out so I don't have to worry about it. Thank you so much!!
  • edited November 10, 2020
    No, you can't convert it, if these are meant to be active citations for the plugin in the document.

    Can you provide a Debug ID from Zotero for an insert that results in this?
  • Okay think I found the Debug ID right. Let me know if this helps at all

    [JavaScript Error: "TypeError: Cannot read property '9' of undefined
    at Object.injectScripts (chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/background.js:330:45)
    at chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/background.js:269:36"]

    [JavaScript Error: "Error: URL changed for tab https://outlook.office.com/mail/search?state=0
    at _updateInfoForTab (chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/background.js:587:49)
    at onNavigation (chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/background.js:895:4)
    at chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/background.js:929:87"]
  • No, that's not a Debug ID, and it's not from Zotero. See the linked instructions.
  • Ah, sorry. I read the directions too quickly and missed the later steps. I enabled logging and then refreshed Zotero in the doc.

    The Debug ID is D516266598
  • That's still the Zotero Connector, not Zotero.
  • Hopefully third time is the charm: D19494779
  • That one's fine, but Adomas will need to look.

    Just to be clear, you're saying that you reliably see HTML or not when you switch back and forth between citation styles?

    Can you reproduce this in a new document?
  • Yes, it happens consistently when I switch between ASA style citations to any other style. In-text citations switch over just fine, but the reference list stays in raw HTML. If I switch back to ASA , it works perfectly well. I has happened several other times when I have tried it in. Now if I create a new document and try to switch back and forth with a couple citations does it fine, but it still won't process HTML in the original document (aka the actual research paper). Other research papers also won't process the new HTML when I switch over to APA either.
  • If you make a copy of the document, does it still happen in the copy? If so, if you can share it, or cut it down to a small excerpt that still demonstrates the problem and share that, send a link to support@zotero.org with a link to this thread and we can take a look.
  • Yes! It does.
    Yes, I will do that. Thank you so, so much. Your help is amazing. I am glad I finally reached out for help (it kept happening on papers and I finally couldn't just do all the fixes by hand anymore!).
  • Wow--okay, I figured it out. When preparing the document for you, I noticed that it worked for a shorter segment, so I kept adding in the paragraphs until it stopped working. I was able to find ONE citation--out of dozens--was messing up the code (it had downloaded a { } in the URL when downloaded it to Zotero through the connector). When I removed the URL, the HTML processed. Wow. I found the same thing was happening on other documents, the citation included a { } around the URL. I would have never figured this out without you. Thank you @dstillman . I'll just have to be careful when I download citations from the internet to make sure that the URL does have that symbol. PROBLEM SOLVED.
  • edited November 10, 2020
    OK, great. I still can't reproduce this, though. You're saying in the URL field in Zotero, the URL has "{" and "}" around it? I'm not seeing that.

    Are you able to provide steps to reproduce this in a new document? (E.g., create a new item in Zotero with x in it, insert it, change styles…)
  • I will do my best. Please let me know if this is clear.

    When I switch from the American Sociological Association to the American Psychological Association reference style, my references would not process from raw HTML.

    When searching through the citations, I noticed that several book citations that I had downloaded through Zotero Connect from my university library included { in them.

    For example the downloaded citation URL was:

    {"http://www.loc.gov/catdir/description/cam051/2004018645.html":["Publisher description"],"http://www.loc.gov/catdir/toc/ecip0421/2004018645.html":["Table of contents"]}

    Because APA citations include the full URL, when these URLs were inserted into the raw HTML, the code would not work. For example:



    There is no error message.

    When I removed the extra material around the URL in Zotero, the raw HTML processed.

    I am not sure if it is possible to reproduce without downloading the citation from my university library, BUT you could try to download the citation and adding in {"http://www.loc.gov/catdir/description/cam051/2004018645.html":["Publisher description"],"http://www.loc.gov/catdir/toc/ecip0421/2004018645.html":["Table of contents"]} in the URL field.

    APA citations and others that include URL will not process when this occurs.

    If you change to, http://www.loc.gov/catdir/description/cam051/2004018645.html, the HTML will process perfectly.

    Let me know if that helps.
  • Please note this forum automatically processed the raw HTML for the book, but it is left raw in google documents and when it is present, none of the other citations will process.
  • Perfect, that does it. It takes more than just the curly brackets -- it's the whole data structure. (data imported from here, e.g.: https://catalog.princeton.edu/catalog/4550207 )
  • To close (part of) the loop, here's the ticket for the incorrect export from the Princeton catalog on their end, they say they're expecting a quick fix: https://github.com/pulibrary/orangelight/issues/2321

    Zotero still shouldn't break here, but it is a fairly unexpected thing to find in the data.
Sign In or Register to comment.