Humans-of-Julia / BibParser.jl

Parser for bibliographic formats, including BibTeX, in pure Julia
MIT License
13 stars 5 forks source link

`@string` definitions bleed into following entry #32

Open goerz opened 1 year ago

goerz commented 1 year ago

In a bib file that has @string definitions at the top, the last string definition seems to bleed into the first bib entry. Consider broken.bib:

@string{zp = "Z. Phys."}

@mastersthesis{GoerzDiploma2010,
    Author = {Goerz, Michael},
    Title = {Optimization of a Controlled Phasegate for Ultracold Calcium Atoms in an Optical Lattice},
    School = {Freie Universität Berlin},
    type = {{Diplomarbeit}},
    url = {http://michaelgoerz.net/research/diploma_thesis.pdf},
    Year = {2010},
}

Here, parsing the file gets Z. Phys. inserted into the author last name:

julia> parse_file("./broken.bib")["GoerzDiploma2010"].authors[1]
BibInternal.Name("", "Z. Phys.Goerz", "", "Michael", "")

I'm guessing some parsing string buffer isn't being cleared.

goerz commented 1 year ago

A workaround is to add @string{XXXclearparser = ""} as the last string definition

goerz commented 1 year ago

Maybe this is the same bug as #28