diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
233 stars 12 forks source link

Citations note fails to parse when containing `<` character #178

Closed Dominic-DallOsto closed 2 years ago

Dominic-DallOsto commented 2 years ago

To reproduce, import this item into Zotero by DOI (10.1103/PhysRevD.40.83), get QID, then sync citations with Wikidata.

Results in the following error message

SyntaxError: JSON.parse: unterminated string at line 1829 column 110 of the JSON data

Changing the citation storage method to use the Extra field (#176) allows syncing of the citations, The error is caused by the title of the following cited item. If syncing the citations to a note, the note will cut off at the < sign.

"title": "Neutrino and antineutrino charged-current inclusive scattering in iron in the energy range 20<E v <300 GeV",

The problem seems to be due to the HTML parser used in SourceItemWrapper, line 176.