auto css_value::maybe_color_from_string(const std::string_view &input)
-> std::optional<css_value> {
- auto found_it = css_colors_map.find(input);
- if (found_it != css_colors_map.end()) {
- return css_value{found_it->second};
+ if (input.size() > 1 && input.front() == '#') {
+ return css_value::maybe_color_from_hex(input.substr(1));
+ }
+ else {
+ auto found_it = css_colors_map.find(input);
+
+ if (found_it != css_colors_map.end()) {
+ return css_value{found_it->second};
+ }
}
return std::nullopt;
"<span style=\"color: #00aff0;\">F</span>Rev<span style=\"opacity: 1;\"></span></span>ie<span style=\"opacity: 1;\"></span>"
"</span>w<span style=\"color: #00aff0;\">F<span style=\"opacity: 1;\">ΜΉ</span></span>",
" Review"},
+ {"<td style=\"color:#ffffff\" bgcolor=\"#005595\">\n"
+ "hello world\n"
+ "</td>", "hello world"},
/* Colors */
{"goodbye <span style=\"COLOR: rgb(64,64,64)\">cruel</span>"
"<span>world</span>", "goodbye cruelworld"},