Support strikethrough
This commit is contained in:
@@ -205,10 +205,12 @@ CssTextDecoration CssParser::interpretDecoration(const std::string& val) {
|
||||
const std::string v = normalized(val);
|
||||
|
||||
// text-decoration can have multiple space-separated values
|
||||
if (v.find("underline") != std::string::npos) {
|
||||
return CssTextDecoration::Underline;
|
||||
}
|
||||
return CssTextDecoration::None;
|
||||
bool underline = v.find("underline") != std::string::npos;
|
||||
bool lineThrough = v.find("line-through") != std::string::npos;
|
||||
uint8_t result = 0;
|
||||
if (underline) result |= static_cast<uint8_t>(CssTextDecoration::Underline);
|
||||
if (lineThrough) result |= static_cast<uint8_t>(CssTextDecoration::LineThrough);
|
||||
return static_cast<CssTextDecoration>(result);
|
||||
}
|
||||
|
||||
CssLength CssParser::interpretLength(const std::string& val) {
|
||||
|
||||
@@ -52,7 +52,7 @@ enum class CssFontStyle : uint8_t { Normal = 0, Italic = 1 };
|
||||
enum class CssFontWeight : uint8_t { Normal = 0, Bold = 1 };
|
||||
|
||||
// Text decoration options
|
||||
enum class CssTextDecoration : uint8_t { None = 0, Underline = 1 };
|
||||
enum class CssTextDecoration : uint8_t { None = 0, Underline = 1, LineThrough = 2, UnderlineLineThrough = 3 };
|
||||
|
||||
// Display options - only None and Block are relevant for e-ink rendering
|
||||
enum class CssDisplay : uint8_t { Block = 0, None = 1 };
|
||||
|
||||
Reference in New Issue
Block a user