bibtex-parser
bibtex-parser copied to clipboard
Problem with \{ in braced values
Hey,
Thanks for a great parser. I'm extending it right now in various ways for use in meteor. In the process I found a bug in your code:
https://github.com/mikolalysenko/bibtex-parser/blob/master/parse-bibtex.js#L106
needs to be:
} else if (this.input[this.pos] == '{' && this.input[this.pos-1] != '\\') {
i.e., you need to guard against escaped opening brackets, too, just like you do for closing ones, otherwise the count gets out of balance.
Let me know if you want a pull request.
cheers!
I also encountered this problem when trying to parse a bibtex with "{" in title. This led to my CPU temperation to 98℃. Thanks chfritz for pointing this out!