Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,11 @@ public static String authEtal(String authorField, String delim,
} else if (tokens.length > 2) {
author.append(append);
}

return author.toString();
if (author.toString().split("\\s")[1].charAt(0) == '{') {
return author.toString().split("\\s")[1].replace("EtAl", "");
} else {
return (author.toString().split("\\s")[1]);
}
}

/**
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/org/jabref/model/entry/AuthorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.jabref.logic.bibtexkeypattern.BibtexKeyGenerator;

class AuthorTest {

@Test
Expand Down Expand Up @@ -39,4 +41,12 @@ void addDotIfAbbreviationDoNotAddDot() {
assertEquals("Moore, O. and O. Moore", Author.addDotIfAbbreviation("Moore, O. and O. Moore"));
assertEquals("Moore, O. and O. Moore and Moore, O. O.", Author.addDotIfAbbreviation("Moore, O. and O. Moore and Moore, O. O."));
}

@Test
public void testAuthEtAlBraces() {
assertEquals("{\\v{S}}pan{\\v{e}}l",
BibtexKeyGenerator.authEtal("Patrik {\\v{S}}pan{\\v{e}}l and Kseniya Dryahina and David Smith", "", "EtAl"));
assertEquals("\\v{S}pan\\v{e}lEtAl",
BibtexKeyGenerator.authEtal("Patrik \\v{S}pan\\v{e}l and Kseniya Dryahina and David Smith", "", "EtAl"));
}
}