Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bibtex: add trailing comma in url field #1900

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

alejandromumo
Copy link
Member

The output of a bibtex export is wrong right now. Note the field url does not have a comma in the end:

@software{daniel_hay_guest_2024_14276439,
  author       = {Daniel Hay Guest and
                  Joshua Wyatt Smith and
                  Michela Paganini and
                  Michael Kagan and
                  Marie Lanfermann and
                  Attila Krasznahorkay and
                  Daniel Edison Marley and
                  Aishik Ghosh and
                  Benjamin Huth and
                  Matthew Feickert},
  title        = {lwtnn/lwtnn: v2.14.1},
  month        = dec,
  year         = 2024,
  publisher    = {Zenodo},
  version      = {v2.14.1},
  doi          = {10.5281/zenodo.14276439},
  url          = {https://doi.org/10.5281/zenodo.14276439}
  swhid        = {swh:1:dir:e8e8cd6fad6becd5e8b193c1148f94e023df3bae
                   ;origin=https://doi.org/10.5281/zenodo.597221;visi
                   t=swh:1:snp:fe7e271159192d7ee02e85798322462a200620
                   a1;anchor=swh:1:rel:698f80ceb7827b6d852a1bbf695eaf
                   b0fccc5079;path=/
                  },
}

@tmorrell
Copy link
Contributor

tmorrell commented Dec 6, 2024

I think the last item shouldn't have a comma. Maybe strip the last entry in parse_fields? I'm not exactly sure how it works with the mixins though.

@ptamarit
Copy link
Member

ptamarit commented Dec 9, 2024

I think the last item shouldn't have a comma. Maybe strip the last entry in parse_fields? I'm not exactly sure how it works with the mixins though.

Several existing tests in test_bibtex_serializer.py have a trailing comma, so it might be fine.
But I agree that it's probably better to be conservative in what we produce and remove the trailing space (if not too difficult).

@slint
Copy link
Member

slint commented Dec 9, 2024

I tried to import in Zotero examples with and without the trailing commas (even in fields in the "middle"), and things seem to work. In general, I feel the best way to test, is to try with existing 3rd-party tools that accept BibTex as input 😅

Given how messy BibTex has been, and sort of in between this weird human/machine-readable uncanny zone, I feel that having trailing commas for all fields should be fine.

@tmorrell
Copy link
Contributor

tmorrell commented Dec 9, 2024

Sounds fine, once tests pass.

@slint slint force-pushed the add_bibtex_url_comma branch 2 times, most recently from 911f7e0 to e1fa71b Compare December 10, 2024 07:24
@slint slint force-pushed the add_bibtex_url_comma branch from e1fa71b to 7133f76 Compare December 10, 2024 08:54
@slint slint merged commit 2b28f50 into inveniosoftware:master Dec 10, 2024
4 checks passed
@slint
Copy link
Member

slint commented Dec 10, 2024

Merging, since I only see JS tests failing for ESlint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released ✔️
Development

Successfully merging this pull request may close these issues.

4 participants