Skip to content

Allow setting the etal-string empty. Implements #1841 #1848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2016
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- [#1758](https://github.com/JabRef/jabref/issues/1758) Added a button to open Database Properties dialog help
- Improve focus of the maintable after a sidepane gets closed (Before it would focus the toolbar or it would focus the wrong entry)
- File open dialogs now use default extensions as primary file filter
- [#1841](https://github.com/JabRef/jabref/issues/1841) The "etal"-string in the Authors layout formatter can now be empty

### Fixed
- Fixed [#1760](https://github.com/JabRef/jabref/issues/1760): Preview updated correctly when selecting a single entry after selecting multiple entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ else if (Authors.SEPARATORS.contains(key.trim().toLowerCase()) || Authors.LAST_S
} else if (comp(key, "LastSep") && !value.isEmpty()) {
lastSeparator = value;
}
} else if ("etal".equalsIgnoreCase(key.trim()) && !value.isEmpty()) {
} else if ("etal".equalsIgnoreCase(key.trim())) {
etAlString = value;
} else if (Authors.NUMBER_PATTERN.matcher(key.trim()).matches()) {
// Just a number:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,12 @@ public void testNoPeriod() {
Assert.assertEquals("B C Bruce, C K von Manson and J Jumper",
a.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly"));
}

@Test
public void testEmptyEtAl() {
ParamLayoutFormatter a = new Authors();
a.setArgument("fullname, LastFirst, Comma, 3, etal=");
Assert.assertEquals("Bruce, Bob Croydon",
a.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"));
}
}