remove newlines and extra spaces when parsing repo name and description
The formatting of these texts should happen in the Android layouts, not with inline whitespace characters.
Este commit está contenido en:
padre
e085bcd54c
commit
8a06aa1c9b
@ -243,7 +243,7 @@ public class RepoXMLHandler extends DefaultHandler {
|
||||
curapp.requirements = Utils.CommaSeparatedList.make(str);
|
||||
}
|
||||
} else if (curel.equals("description")) {
|
||||
description = str;
|
||||
description = cleanWhiteSpace(str);
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,10 +273,10 @@ public class RepoXMLHandler extends DefaultHandler {
|
||||
|
||||
String nm = attributes.getValue("", "name");
|
||||
if (nm != null)
|
||||
name = nm;
|
||||
name = cleanWhiteSpace(nm);
|
||||
String dc = attributes.getValue("", "description");
|
||||
if (dc != null)
|
||||
description = dc;
|
||||
description = cleanWhiteSpace(dc);
|
||||
|
||||
} else if (localName.equals("application") && curapp == null) {
|
||||
curapp = new App();
|
||||
@ -306,4 +306,8 @@ public class RepoXMLHandler extends DefaultHandler {
|
||||
public void setTotalAppCount(int totalAppCount) {
|
||||
this.totalAppCount = totalAppCount;
|
||||
}
|
||||
|
||||
private String cleanWhiteSpace(String str) {
|
||||
return str.replaceAll("\n", " ").replaceAll(" ", " ");
|
||||
}
|
||||
}
|
||||
|
||||
Cargando…
x
Referencia en una nueva incidencia
Block a user