cur = tag->params->head;
img = rspamd_mempool_alloc0 (pool, sizeof (*img));
img->tag = tag;
+ tag->flags |= FL_IMAGE;
while (cur) {
comp = cur->data;
msg_debug_html ("got valid base tag");
hc->base_url = url;
cur_tag->extra = url;
+ cur_tag->flags |= FL_HREF;
}
else {
msg_debug_html ("got invalid base tag!");
#define FL_IGNORE (1 << 27)
#define FL_BLOCK (1 << 28)
#define FL_HREF (1 << 29)
+#define FL_IMAGE (1 << 30)
struct html_tag {
gint id;
if (ltag) {
if (ltag->tag->extra) {
- if ((ltag->tag->flags & FL_HREF) || ltag->tag->id == Tag_BASE) {
+ if (ltag->tag->flags & FL_IMAGE) {
+ img = ltag->tag->extra;
+ lua_html_push_image (L, img);
+ }
+ else if (ltag->tag->flags & FL_HREF) {
/* For A that's URL */
purl = lua_newuserdata (L, sizeof (gpointer));
*purl = ltag->tag->extra;
rspamd_lua_setclass (L, "rspamd{url}", -1);
}
- else if (ltag->tag->id == Tag_IMG) {
- img = ltag->tag->extra;
- lua_html_push_image (L, img);
- }
else if (ltag->tag->flags & FL_BLOCK) {
lua_html_push_block (L, ltag->tag->extra);
}