The previous commit attempted to fix
Welcome back, Felix Dörre !
but instead produced
Welcome back, FelixDörre!
Clearly, while we don’t want spaces around the full name, there should
be spaces in between the individual name parts.
Change-Id: I498ea9a0fdaf0f5b3191a3fc3cc47d0a3187b4f5
@Override
public void output(PrintWriter out) {
@Override
public void output(PrintWriter out) {
- outputNameParts(out, "fname", firstNames);
- outputNameParts(out, "lname", lastNames);
- outputNameParts(out, "suffix", suffixes);
+ outputNameParts(out, "fname", firstNames, false);
+ outputNameParts(out, "lname", lastNames, true);
+ outputNameParts(out, "suffix", suffixes, true);
- private void outputNameParts(PrintWriter out, String type, NamePart[] input) {
+ private void outputNameParts(PrintWriter out, String type, NamePart[] input, boolean leadingSpace) {
StringBuilder res;
res = new StringBuilder();
appendArray(res, input);
if (res.length() > 0) {
res.deleteCharAt(res.length() - 1);
StringBuilder res;
res = new StringBuilder();
appendArray(res, input);
if (res.length() > 0) {
res.deleteCharAt(res.length() - 1);
+ if (leadingSpace) {
+ out.print(" ");
+ }
out.print("<span class='" + type + "'>");
out.print(HTMLEncoder.encodeHTML(res.toString()));
out.print("</span>");
out.print("<span class='" + type + "'>");
out.print(HTMLEncoder.encodeHTML(res.toString()));
out.print("</span>");