bibtex-ruby
bibtex-ruby copied to clipboard
Braces in citekey
When a citekey has braces the parser can't handle it. Maybe we should strip them when processing?
The example bibtex I've got:
@book{book:{421090},
title = {Fuzzy Reasoning in Information...)},
author = {S.G. Tzafestas, Anastasios N. Venetsanopoulos},
}
Error
BibTeX::ParseError:
Failed to parse BibTeX on value "{" (LBRACE) ["@", #<BibTeX::Entry >, "book:"]
# bibtex.y:138:in `on_error'
# (eval):3:in `_racc_do_parse_c'
# (eval):3:in `do_parse'
# bibtex.y:111:in `parse'
Using the latex filter produces the same result.
I don't remember if BibTeX itself allows such keys, but I vaguely remember that we already made changes in the past to be less strict with the key syntax, so we can probably do the same here. If I'm not mistaken you'd just have to change the lexer pattern for keys here. You can probably test this at runtime even by adjusting BibTeX::Lexer.defaults
or passing the options to Bibliography.parse
which, I think, passes them through all the way to the lexer instantiation.
ok! I'll try to make the change.