From 171983fed36625b8ded23955be74ee66169b7765 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Mon, 20 Jan 2014 10:06:06 +0100 Subject: [PATCH] Fix Entry#contained? Some applications, like BibDesk set the title and the booktitle to the same value. This would lead to a false positive when calling #contained? --- lib/bibtex/entry.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bibtex/entry.rb b/lib/bibtex/entry.rb index 68004c1..f45c09b 100644 --- a/lib/bibtex/entry.rb +++ b/lib/bibtex/entry.rb @@ -564,7 +564,8 @@ def pages_to # Returns true if this entry is published inside a book, collection or journal def contained? - has_field?(:booktitle, :container, :journal) + has_field?(:container, :journal) || + has_field?(:booktitle) && get(:booktitle) != get(:title) end # Returns an array containing the values associated with the given keys.