Skip font size/weight for top element

pull/174/head
M66B 6 years ago
parent 531aad4504
commit 74c5937b63

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

Loading…
Cancel
Save