1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Skip font size/weight for top element

This commit is contained in:
M66B 2020-02-10 09:29:47 +01:00
parent 531aad4504
commit 74c5937b63

View file

@ -379,22 +379,26 @@ public class HtmlHelper {
case "font-size":
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
Float fsize = getFontSize(value);
if (fsize != null && fsize != 0 &&
(fsize <= 0.8f || fsize >= 1.25)) {
Element e = new Element(fsize < 1 ? "small" : "big");
element.replaceWith(e);
e.appendChild(element);
if (element.parent() != null) {
Float fsize = getFontSize(value);
if (fsize != null && fsize != 0 &&
(fsize <= 0.8f || fsize >= 1.25)) {
Element e = new Element(fsize < 1 ? "small" : "big");
element.replaceWith(e);
e.appendChild(element);
}
}
break;
case "font-weight":
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
Integer fweight = getFontWeight(value);
if (fweight != null && fweight >= 600) {
Element strong = new Element("strong");
element.replaceWith(strong);
strong.appendChild(element);
if (element.parent() != null) {
Integer fweight = getFontWeight(value);
if (fweight != null && fweight >= 600) {
Element strong = new Element("strong");
element.replaceWith(strong);
strong.appendChild(element);
}
}
break;