img = rspamd_mempool_alloc0_type (pool, struct html_image);
img->tag = tag;
- tag->flags |= FL_IMAGE;
-
for (const auto ¶m : tag->parameters) {
}
if (!tag->block) {
- is_visible = true;
+ if ((tag->flags & (FL_COMMENT|FL_XML))) {
+ is_visible = false;
+ }
+ else {
+ is_visible = true;
+ }
}
else if (!tag->block->is_visible()) {
is_visible = false;
break;
case '!':
state = sgml_tag;
+ hc->all_tags.emplace_back(std::make_unique<html_tag>());
+ cur_tag = hc->all_tags.back().get();
+ cur_tag->tag_start = c - start;
p ++;
break;
case '?':
state = xml_tag;
+ hc->all_tags.emplace_back(std::make_unique<html_tag>());
+ cur_tag = hc->all_tags.back().get();
+ cur_tag->tag_start = c - start;
+ cur_tag->flags |= FL_XML;
hc->flags |= RSPAMD_HTML_FLAG_XML;
p ++;
break;
p ++;
break;
case '-':
+ cur_tag->flags |= FL_COMMENT;
state = comment_tag;
p ++;
break;
};
-/* Public tags flags */
-/* XML tag */
-#define FL_XML (1 << 23)
-/* Closing tag */
-#define FL_CLOSING (1 << 24)
-/* Fully closed tag (e.g. <a attrs />) */
-#define FL_CLOSED (1 << 25)
-#define FL_BROKEN (1 << 26)
-#define FL_IGNORE (1 << 27)
-#define FL_BLOCK (1 << 28)
-#define FL_HREF (1 << 29)
-#define FL_IMAGE (1 << 30)
-
/* Forwarded declaration */
struct rspamd_task;
RSPAMD_HTML_COMPONENT_ALT,
RSPAMD_HTML_COMPONENT_ID,
};
+
+/* Public tags flags */
+/* XML tag */
+#define FL_XML (1 << 23)
+/* Closing tag */
+#define FL_CLOSING (1 << 24)
+/* Fully closed tag (e.g. <a attrs />) */
+#define FL_CLOSED (1 << 25)
+#define FL_BROKEN (1 << 26)
+#define FL_IGNORE (1 << 27)
+#define FL_BLOCK (1 << 28)
+#define FL_HREF (1 << 29)
+#define FL_COMMENT (1 << 29)
+
/**
* Returns component type from a string
* @param st