{
struct html_tag_component *comp;
GList *cur;
+ struct rspamd_url *url;
cur = tag->params->head;
comp = cur->data;
if (comp->type == RSPAMD_HTML_COMPONENT_HREF && comp->len > 0) {
- return rspamd_html_process_url (pool, comp->start, comp->len, comp);
+ url = rspamd_html_process_url (pool, comp->start, comp->len, comp);
+
+ if (url && tag->extra == NULL) {
+ tag->extra = url;
+ }
+
+ return url;
}
cur = g_list_next (cur);
cur = tag->params->head;
img = rspamd_mempool_alloc0 (pool, sizeof (*img));
+ img->tag = tag;
while (cur) {
comp = cur->data;
}
g_ptr_array_add (hc->images, img);
+ tag->extra = img;
}
/* Keep sorted by name */
}
g_ptr_array_add (hc->blocks, bl);
+ tag->extra = bl;
}
GByteArray*
struct html_tag_component {
enum html_component_type type;
- const guchar *start;
guint len;
+ const guchar *start;
};
struct html_image {
guint width;
guint flags;
gchar *src;
+ struct html_tag *tag;
};
struct html_color {
struct html_tag {
gint id;
+ gint flags;
struct html_tag_component name;
GQueue *params;
- gint flags;
+ gpointer extra; /** Additional data associated with tag (e.g. image) */
};
/* Forwarded declaration */