inukshuk / bibtex-ruby

A BibTeX library, parser, and converter for Ruby.
http://inukshuk.github.com/bibtex-ruby
GNU General Public License v3.0
156 stars 31 forks source link

bibtex-ruby should not convert strings entries to integer #100

Closed DamienRobert closed 9 years ago

DamienRobert commented 9 years ago

For instance

BibTeX::Entry.new({eprint: " 1001.1234"}).to_s
# => "@{unknown-a,\n  eprint = {1001}\n}\n"

The eprint field is used by biblatex to put hyperlinks (here this is an arxiv reference). If the strings get mangled, the reference is not valid anymore. It looks as if bibtex-ruby is trying to convert the string to an integer, even though I gave him a string and not an integer. I guess this could make sense for some fields (eg 'page') but not for all fields. This behaviour was not happening in older versions, I can bisect it to check when the regression happened if you need. Thanks!

inukshuk commented 9 years ago

Thanks for reporting!

Yes, indeed, this was introduced recently, because we wanted to sort numeric values as numbers, but obviously the conversion should not happen when calling #to_s

inukshuk commented 9 years ago

Fixed in 4.0.10

DamienRobert commented 9 years ago

From Sylvester Keil, Fri 23 Jan 2015 at 09:52:58 (-0800) :

Fixed in 4.0.10

I confirm that it works, thanks! I am impressed by your reactivity!