Added support for CSS font-style

This commit is contained in:
M66B 2022-04-04 14:49:23 +02:00
parent 53262f88cd
commit 7b285e8fa8
1 changed files with 10 additions and 0 deletions

View File

@ -844,6 +844,12 @@ public class HtmlHelper {
sb.append(key).append(":").append(value).append(";");
break;
case "font-style":
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
if (value.contains("italic") || value.contains("oblique"))
sb.append(key).append(":").append("italic").append(";");
break;
case "text-decoration":
case "text-decoration-line":
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
@ -3151,6 +3157,10 @@ public class HtmlHelper {
} else
setSpan(ssb, StyleHelper.getTypefaceSpan(value, context), start, ssb.length());
break;
case "font-style":
if ("italic".equals(value))
setSpan(ssb, new StyleSpan(Typeface.ITALIC), start, ssb.length());
break;
case "text-decoration":
if ("line-through".equals(value))
setSpan(ssb, new StrikethroughSpan(), start, ssb.length());