retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.39k stars 290 forks source link

Duplicate "note" is not correctly commented out in biblatex output #3040

Open ryofurue opened 3 weeks ago

ryofurue commented 3 weeks ago

Debug log ID

3ZW88UUZ-apse/6.7.248-6

What happened?

I have a note TEOS-10 homepage is http://www.teos-10.org/index.htm

written by me and attached to an entry. The entry also has a string "OCLC: 724024071" in the Extra field, which was inserted there by the Zotero browser plugin.

The biblatex output then includes this extra info

% == BibLateX quality report for McDougallTJ.BarkerPM:2011:
% duplicate "note" ("<div data-schema-version="8"><p>TEOS-10 homepage is <a href="http://www.teos-10.org/index.htm" rel="noopener noreferrer nofollow">http://www.teos-10.org/index.htm</a></p>
</div>") ignored
% ? unused Library catalog ("Open WorldCat")

Note that there is a linebreak between</p> and </div>. As a result, the piece of text </div>") ignored is not commented out and biber complains

WARN - BibTeX subsystem: /var/folders/vq/54_v0z752kv_2ptqsy1vxbrw0000gn/T/biber_tmp_tfQf/68a3e86a5eef43cd0fa2ad5ac320682f_4880.utf8, line 14557, warning: 15 characters of junk seen at toplevel
retorquere commented 3 weeks ago

Can you get me a debug log by right-clicking that item and sending the log from the popup menu?

ryofurue commented 3 weeks ago

Can you get me a debug log by right-clicking that item and sending the log from the popup menu?

ACBSRIYI-refs-apse/6.7.248-6

I've modify the entry somewhat but the problem is the same:

@book{McDougallTJ.Barker-delete-me,
  title = {Getting started with {{TEOS-10}} and the {{Gibbs Seawater}} ({{GSW}}) {{Oceanographic Toolbox}}},
  author = {McDougall, Trevor J and Barker, Paul M},
  date = {2011},
  publisher = {Trevor J McDougall},
  location = {Battery Point, Tasmania, Australia},
  url = {https://www.teos-10.org/pubs/Getting_Started.pdf},
  isbn = {978-0-646-55621-5},
  language = {English},
  annotation = {OCLC: 724024071},
  note = {OCLC: 724024071}
}
% == BibLateX quality report for McDougallTJ.Barker-delete-me:
% duplicate "note" ("<div data-schema-version="8"><p>http://www.teos-10.org/index.htm</p>
</div>") ignored
% ? unused Library catalog ("Open WorldCat")

</div>") ignored is printed after the newline.

retorquere commented 3 weeks ago

I cannot reproduce the problem with ACBSRIYI-refs-apse/6.7.248-6. <div data-schema-version="8"> also does not appear in it anywhere.

retorquere commented 2 weeks ago

I think I have a fix but without a testcase I can't prevent regressions later

github-actions[bot] commented 2 weeks ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.248.7247 ("cleanup")

This update may name other issues, but the build just dropped here is for you; it just means problems already fixed in other issues have been folded into the work we are doing here. Install in Zotero by downloading test build 6.7.248.7247, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

ryofurue commented 2 weeks ago

The test build fixed the problem. Thank you!!! The following is the current biblatex database generated by BBT:

% . . .
@book{McDougallTJ.Barker-delete-me,
  title = {Getting started with {{TEOS-10}} and the {{Gibbs Seawater}} ({{GSW}}) {{Oceanographic Toolbox}}},
  author = {McDougall, Trevor J and Barker, Paul M},
  date = {2011},
  publisher = {Trevor J McDougall},
  location = {Battery Point, Tasmania, Australia},
  url = {https://www.teos-10.org/pubs/Getting_Started.pdf},
  isbn = {978-0-646-55621-5},
  language = {English},
  annotation = {OCLC: 724024071},
  note = {OCLC: 724024071}
}
% == BibLateX quality report for McDougallTJ.Barker-delete-me:
% duplicate "note" ("<div data-schema-version="8"><p>http://www.teos-10.org/index.htm</p> </div>") ignored
% ? unused Library catalog ("Open WorldCat")
% . . .

The HTML code <div data-schema-version="8" . . . must be from the "note" I attached to the entry. I just wrote "http://www.teos-10.org/index.htm" there.

retorquere commented 2 weeks ago

Yeah I know but I'd prefer to have the actual case in my test suite. The log you sent doesn't have the note that caused the problem so I have no test case to prevent regression.

retorquere commented 2 weeks ago

I have not been able to reproduce the problem. Can you please send a debug from an item where you could reproduce the problem, and make sure to check the "notes" checkbox in the debug log. I don't really want to release code for which I can't reproduce the behavior it was supposed to address.