Skip to content

Commit

Permalink
removes title from usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
tjuerge committed Jul 10, 2024
1 parent 62d79b0 commit 8c8d812
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,14 @@ private List<ConfluencePage> getMappedPages(String firstName, String lastName) {
}

/**
* If username specified as "<last name>, <first name>" then convert to "<first name> <last name>".
* Remove title (Dr.), diacritics (like accents) and if username specified as "<last name>, <first name>" then convert to "<first name> <last name>".
*/
public static Function<String, String> normalizeUsername() {
return username -> {
if (username.startsWith("Dr. ")) {
username = username.substring(4);
}
// username = Normalizer.normalize(username, Normalizer.Form.NFKD).replaceAll("\\p{M}", "");
int delimiterPos = username.indexOf(",");
if (delimiterPos >= 0) {
return username.substring(delimiterPos + 1).trim() + " " + username.substring(0, delimiterPos).trim();
Expand Down

0 comments on commit 8c8d812

Please sign in to comment.