static struct html_tag_def tag_defs[] = {
/* W3C defined elements */
- TAG_DEF(Tag_A, "a", 0),
+ TAG_DEF(Tag_A, "a", FL_HREF),
TAG_DEF(Tag_ABBR, "abbr", (CM_INLINE)),
TAG_DEF(Tag_ACRONYM, "acronym", (CM_INLINE)),
TAG_DEF(Tag_ADDRESS, "address", (CM_BLOCK)),
TAG_DEF(Tag_APPLET, "applet", (CM_OBJECT | CM_IMG | CM_INLINE | CM_PARAM)),
- TAG_DEF(Tag_AREA, "area", (CM_BLOCK | CM_EMPTY)),
+ TAG_DEF(Tag_AREA, "area", (CM_BLOCK | CM_EMPTY | FL_HREF)),
TAG_DEF(Tag_B, "b", (CM_INLINE|FL_BLOCK)),
TAG_DEF(Tag_BASE, "base", (CM_HEAD | CM_EMPTY)),
TAG_DEF(Tag_BASEFONT, "basefont", (CM_INLINE | CM_EMPTY)),
TAG_DEF(Tag_FIELDSET, "fieldset", (CM_BLOCK)),
TAG_DEF(Tag_FONT, "font", (FL_BLOCK)),
TAG_DEF(Tag_FORM, "form", (CM_BLOCK)),
- TAG_DEF(Tag_FRAME, "frame", (CM_FRAMES | CM_EMPTY)),
+ TAG_DEF(Tag_FRAME, "frame", (CM_FRAMES | CM_EMPTY | FL_HREF)),
TAG_DEF(Tag_FRAMESET, "frameset", (CM_HTML | CM_FRAMES)),
TAG_DEF(Tag_H1, "h1", (CM_BLOCK | CM_HEADING)),
TAG_DEF(Tag_H2, "h2", (CM_BLOCK | CM_HEADING)),
TAG_DEF(Tag_HR, "hr", (CM_BLOCK | CM_EMPTY)),
TAG_DEF(Tag_HTML, "html", (CM_HTML | CM_OPT | CM_OMITST | CM_UNIQUE)),
TAG_DEF(Tag_I, "i", (CM_INLINE)),
- TAG_DEF(Tag_IFRAME, "iframe", (0)),
+ TAG_DEF(Tag_IFRAME, "iframe", (FL_HREF)),
TAG_DEF(Tag_IMG, "img", (CM_INLINE | CM_IMG | CM_EMPTY)),
TAG_DEF(Tag_INPUT, "input", (CM_INLINE | CM_IMG | CM_EMPTY)),
TAG_DEF(Tag_INS, "ins", (CM_INLINE | CM_BLOCK | CM_MIXED)),
TAG_DEF(Tag_LABEL, "label", (CM_INLINE)),
TAG_DEF(Tag_LEGEND, "legend", (CM_INLINE)),
TAG_DEF(Tag_LI, "li", (CM_LIST | CM_OPT | CM_NO_INDENT | FL_BLOCK)),
- TAG_DEF(Tag_LINK, "link", (CM_HEAD | CM_EMPTY)),
+ TAG_DEF(Tag_LINK, "link", (CM_HEAD | CM_EMPTY|FL_HREF)),
TAG_DEF(Tag_LISTING, "listing", (CM_BLOCK | CM_OBSOLETE)),
- TAG_DEF(Tag_MAP, "map", (CM_INLINE)),
+ TAG_DEF(Tag_MAP, "map", (CM_INLINE|FL_HREF)),
TAG_DEF(Tag_MENU, "menu", (CM_BLOCK | CM_OBSOLETE)),
TAG_DEF(Tag_META, "meta", (CM_HEAD | CM_INLINE | CM_EMPTY)),
TAG_DEF(Tag_NOFRAMES, "noframes", (CM_BLOCK | CM_FRAMES)),
save_space = FALSE;
}
- if (cur_tag->id == Tag_A || cur_tag->id == Tag_IFRAME) {
+ if (cur_tag->flags & FL_HREF) {
if (!(cur_tag->flags & (FL_CLOSING))) {
url = rspamd_html_process_url_tag (pool, cur_tag, hc);
}
}
}
- else if (cur_tag->id == Tag_LINK) {
- url = rspamd_html_process_url_tag (pool, cur_tag, hc);
- }
else if (cur_tag->id == Tag_BASE && !(cur_tag->flags & (FL_CLOSING))) {
struct html_tag *prev_tag = NULL;