ropensci / bibtex

bibtex parser for R
https://docs.ropensci.org/bibtex/
35 stars 12 forks source link

Issue with "\\}$" #49

Closed arcuri82 closed 7 months ago

arcuri82 commented 1 year ago

Hi, thanks for developing and maintaining this package. I am having an issue with bibtex returning no entry when reading a bib file (with more than 1000 entries), and no error message is given.

After using a debugger to find out what is going on, there a few places in which there is code like:

guess_eoentry <- max(grep("\\}$", entry_lines))
...
guess_eostring <- max(grep("\\}$", string_line))

this crashes (with no error message) the parser when there are spaces after the closing }, eg, }. Not super-familiar with regex in R, but likely should be something like "\\}\\s*$"

coatless commented 1 year ago

@arcuri82 sorry for the late reply.

By chance do you have a bibtex entry that I could use to confirm the error and solution being proposed?

coatless commented 7 months ago

Closing the issue as we haven't heard back from over a year ago.