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

bug: incorrect handling of lastnames with whitespaces #167

Open CheariX opened 7 months ago

CheariX commented 7 months ago

One of my co-author's lastname could not be correctly parsed due to whitespaces. I'm referring to this Bibtex entry. The BibTeX was condensed to the essential components as demonstrated in the code example provided below.

require 'bibtex'

b = BibTeX.parse <<-END
@inproceedings{10.1145/3319535.3339812,
author = {Mladenov, Vladislav and Mainka, Christian and Meyer zu Selhausen, Karsten and Grothe, Martin and Schwenk, J\"{o}rg},
}
END

if b['10.1145/3319535.3339812'].author[2].last == "Meyer zu Selhausen"
    puts "Correct."
   else
    puts "Incorrect. Should be: 'Meyer zu Selhausen'. Current: '#{b['10.1145/3319535.3339812'].author[2].last}'"
   end

Output:

Incorrect. Should be: 'Meyer zu Selhausen'. Current: 'Selhausen'