Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bibtexparser/customization.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ def author(record):
"""
if "author" in record:
if record["author"]:
record["author"] = getnames([i.strip() for i in record["author"].replace('\n', ' ').split(" and ")])
record["author"] = getnames([i.strip() for i in re.split(r"\ and\ ", record["author"].replace('\n', ' '),
flags=re.IGNORECASE)])
else:
del record["author"]
return record
Expand Down
8 changes: 8 additions & 0 deletions bibtexparser/tests/data/book_capital_AND.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@BOOK{Bird1987,
title = {Dynamics of Polymeric Liquid},
publisher = {Wiley Edition},
year = {1987},
author = {Bird, R.B. and Armstrong, R.C. AND Hassager, O.},
volume = {1},
edition = {2},
}
2 changes: 1 addition & 1 deletion bibtexparser/tests/test_bparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def test_book(self):
self.assertEqual(res, expected)

def test_book_cust_unicode(self):
with open('bibtexparser/tests/data/book.bib', 'r') as bibfile:
with open('bibtexparser/tests/data/book_capital_AND.bib', 'r') as bibfile:
bib = BibTexParser(bibfile.read(), customization=customizations_unicode)
res = bib.get_entry_list()
expected = [{'ENTRYTYPE': 'book',
Expand Down