Escape face names

This commit is contained in:
M66B 2021-04-20 08:01:03 +02:00
parent d3fbca7b74
commit 2eb90bc2c3
1 changed files with 14 additions and 2 deletions

View File

@ -496,8 +496,20 @@ public class HtmlHelper {
} }
} }
if (!TextUtils.isEmpty(face)) if (!TextUtils.isEmpty(face)) {
sb.append("font-family:").append(face).append(";"); 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()); font.attr("style", sb.toString());