{"rel", html_component_type::RSPAMD_HTML_COMPONENT_REL},
{"alt", html_component_type::RSPAMD_HTML_COMPONENT_ALT},
{"id", html_component_type::RSPAMD_HTML_COMPONENT_ID},
+ {"hidden", html_component_type::RSPAMD_HTML_COMPONENT_HIDDEN},
});
#define msg_debug_html(...) rspamd_conditional_debug_fast (NULL, NULL, \
struct html_content *hc) -> void
{
std::optional<css::css_value> maybe_fgcolor, maybe_bgcolor;
+ bool hidden = false;
for (const auto ¶m : tag->components) {
if (param.type == html_component_type::RSPAMD_HTML_COMPONENT_COLOR) {
if (param.type == html_component_type::RSPAMD_HTML_COMPONENT_STYLE) {
tag->block = rspamd::css::parse_css_declaration(pool, param.value);
}
+
+ if (param.type == html_component_type::RSPAMD_HTML_COMPONENT_HIDDEN) {
+ hidden = true;
+ }
}
if (!tag->block) {
tag->block = html_block::undefined_html_block_pool(pool);
}
+ if (hidden) {
+ tag->block->set_display(false);
+ }
+
if (maybe_fgcolor) {
tag->block->set_fgcolor(maybe_fgcolor->to_color().value());
}
"<p style=\"font-size: 11px; line-height: 1.2; color: #555555; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; mso-line-height-alt: 14px; margin: 0;\">\n"
" </p>",
" Sincerely,\n Skype Web\n"},
+ {"lala<p hidden>fafa</p>", "lala\n"},
/* bgcolor propagation */
{"<a style=\"display: inline-block; color: #ffffff; background-color: #00aff0;\">\n"
"<span style=\"color: #00aff0;\">F</span>Rev<span style=\"opacity: 1;\"></span></span>ie<span style=\"opacity: 1;\"></span>"