mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Escape face names
This commit is contained in:
parent
d3fbca7b74
commit
2eb90bc2c3
1 changed files with 14 additions and 2 deletions
|
@ -496,8 +496,20 @@ public class HtmlHelper {
|
|||
}
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(face))
|
||||
sb.append("font-family:").append(face).append(";");
|
||||
if (!TextUtils.isEmpty(face)) {
|
||||
sb.append("font-family:");
|
||||
String[] faces = face.split(",");
|
||||
for (int i = 0; i < faces.length; i++) {
|
||||
if (i > 0)
|
||||
sb.append(',');
|
||||
String f = faces[i].trim();
|
||||
if (f.contains(" ") && !f.startsWith("\"") && !f.endsWith("\""))
|
||||
sb.append('"').append(f).append('"');
|
||||
else
|
||||
sb.append(f);
|
||||
}
|
||||
sb.append(";");
|
||||
}
|
||||
|
||||
font.attr("style", sb.toString());
|
||||
|
||||
|
|
Loading…
Reference in a new issue