Skip font size/weight for top element

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

@ -379,22 +379,26 @@ 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
Float fsize = getFontSize(value); if (element.parent() != null) {
if (fsize != null && fsize != 0 && Float fsize = getFontSize(value);
(fsize <= 0.8f || fsize >= 1.25)) { if (fsize != null && fsize != 0 &&
Element e = new Element(fsize < 1 ? "small" : "big"); (fsize <= 0.8f || fsize >= 1.25)) {
element.replaceWith(e); Element e = new Element(fsize < 1 ? "small" : "big");
e.appendChild(element); element.replaceWith(e);
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
Integer fweight = getFontWeight(value); if (element.parent() != null) {
if (fweight != null && fweight >= 600) { Integer fweight = getFontWeight(value);
Element strong = new Element("strong"); if (fweight != null && fweight >= 600) {
element.replaceWith(strong); Element strong = new Element("strong");
strong.appendChild(element); element.replaceWith(strong);
strong.appendChild(element);
}
} }
break; break;

Loading…
Cancel
Save