Add SVG tags to set of all tags

This commit is contained in:
Wilson Lin 2018-08-04 16:00:39 +12:00
parent c53b522c38
commit 26bbe20a04
3 changed files with 177 additions and 156 deletions

View File

@ -27,10 +27,11 @@
#include "./tag/mediatags.c"
#include "./tag/sectioningtags.c"
#include "./tag/specifictags.c"
#include "./tag/tags.c"
#include "./tag/voidtags.c"
#include "./tag/wsstags.c"
#include "./tag/htmltags.c"
#include "./tag/svgtags.c"
#include "./tag/tags.c"
void hbr_init(void) {
// Core
@ -58,6 +59,7 @@ void hbr_init(void) {
hbr_voidtags_init();
hbr_wsstags_init();
hbr_htmltags_init();
hbr_svgtags_init();
hbr_tags_init();

View File

@ -0,0 +1,170 @@
#ifndef _HDR_HYPERBUILD_RULE_HTMLTAGS
#define _HDR_HYPERBUILD_RULE_HTMLTAGS
#include "../../ext/nicehash/set/str.h"
#include "../../util/hbchar.h"
// Sourced from https://developer.mozilla.org/en-US/docs/Web/HTML/Element at 2018-07-01T05:55:00Z
static nh_set_str_t hbr_htmltags_set;
void hbr_htmltags_init(void) {
hbr_htmltags_set = nh_set_str_create();
nh_set_str_add(hbr_htmltags_set, "a");
nh_set_str_add(hbr_htmltags_set, "abbr");
nh_set_str_add(hbr_htmltags_set, "acronym");
nh_set_str_add(hbr_htmltags_set, "address");
nh_set_str_add(hbr_htmltags_set, "applet");
nh_set_str_add(hbr_htmltags_set, "applet");
nh_set_str_add(hbr_htmltags_set, "area");
nh_set_str_add(hbr_htmltags_set, "article");
nh_set_str_add(hbr_htmltags_set, "aside");
nh_set_str_add(hbr_htmltags_set, "audio");
nh_set_str_add(hbr_htmltags_set, "b");
nh_set_str_add(hbr_htmltags_set, "basefont");
nh_set_str_add(hbr_htmltags_set, "bdi");
nh_set_str_add(hbr_htmltags_set, "bdo");
nh_set_str_add(hbr_htmltags_set, "bgsound");
nh_set_str_add(hbr_htmltags_set, "big");
nh_set_str_add(hbr_htmltags_set, "blink");
nh_set_str_add(hbr_htmltags_set, "blockquote");
nh_set_str_add(hbr_htmltags_set, "body");
nh_set_str_add(hbr_htmltags_set, "br");
nh_set_str_add(hbr_htmltags_set, "button");
nh_set_str_add(hbr_htmltags_set, "canvas");
nh_set_str_add(hbr_htmltags_set, "caption");
nh_set_str_add(hbr_htmltags_set, "center");
nh_set_str_add(hbr_htmltags_set, "cite");
nh_set_str_add(hbr_htmltags_set, "code");
nh_set_str_add(hbr_htmltags_set, "col");
nh_set_str_add(hbr_htmltags_set, "colgroup");
nh_set_str_add(hbr_htmltags_set, "command");
nh_set_str_add(hbr_htmltags_set, "content");
nh_set_str_add(hbr_htmltags_set, "content");
nh_set_str_add(hbr_htmltags_set, "data");
nh_set_str_add(hbr_htmltags_set, "datalist");
nh_set_str_add(hbr_htmltags_set, "dd");
nh_set_str_add(hbr_htmltags_set, "del");
nh_set_str_add(hbr_htmltags_set, "details");
nh_set_str_add(hbr_htmltags_set, "dfn");
nh_set_str_add(hbr_htmltags_set, "dialog");
nh_set_str_add(hbr_htmltags_set, "dir");
nh_set_str_add(hbr_htmltags_set, "dir");
nh_set_str_add(hbr_htmltags_set, "div");
nh_set_str_add(hbr_htmltags_set, "dl");
nh_set_str_add(hbr_htmltags_set, "dt");
nh_set_str_add(hbr_htmltags_set, "element");
nh_set_str_add(hbr_htmltags_set, "element");
nh_set_str_add(hbr_htmltags_set, "em");
nh_set_str_add(hbr_htmltags_set, "embed");
nh_set_str_add(hbr_htmltags_set, "fieldset");
nh_set_str_add(hbr_htmltags_set, "figcaption");
nh_set_str_add(hbr_htmltags_set, "figure");
nh_set_str_add(hbr_htmltags_set, "font");
nh_set_str_add(hbr_htmltags_set, "footer");
nh_set_str_add(hbr_htmltags_set, "form");
nh_set_str_add(hbr_htmltags_set, "frame");
nh_set_str_add(hbr_htmltags_set, "frameset");
nh_set_str_add(hbr_htmltags_set, "h1");
nh_set_str_add(hbr_htmltags_set, "h2");
nh_set_str_add(hbr_htmltags_set, "h3");
nh_set_str_add(hbr_htmltags_set, "h4");
nh_set_str_add(hbr_htmltags_set, "h5");
nh_set_str_add(hbr_htmltags_set, "h6");
nh_set_str_add(hbr_htmltags_set, "head");
nh_set_str_add(hbr_htmltags_set, "header");
nh_set_str_add(hbr_htmltags_set, "hgroup");
nh_set_str_add(hbr_htmltags_set, "hr");
nh_set_str_add(hbr_htmltags_set, "html");
nh_set_str_add(hbr_htmltags_set, "i");
nh_set_str_add(hbr_htmltags_set, "iframe");
nh_set_str_add(hbr_htmltags_set, "image");
nh_set_str_add(hbr_htmltags_set, "img");
nh_set_str_add(hbr_htmltags_set, "input");
nh_set_str_add(hbr_htmltags_set, "ins");
nh_set_str_add(hbr_htmltags_set, "isindex");
nh_set_str_add(hbr_htmltags_set, "kbd");
nh_set_str_add(hbr_htmltags_set, "keygen");
nh_set_str_add(hbr_htmltags_set, "label");
nh_set_str_add(hbr_htmltags_set, "legend");
nh_set_str_add(hbr_htmltags_set, "li");
nh_set_str_add(hbr_htmltags_set, "link");
nh_set_str_add(hbr_htmltags_set, "listing");
nh_set_str_add(hbr_htmltags_set, "main");
nh_set_str_add(hbr_htmltags_set, "map");
nh_set_str_add(hbr_htmltags_set, "mark");
nh_set_str_add(hbr_htmltags_set, "marquee");
nh_set_str_add(hbr_htmltags_set, "menu");
nh_set_str_add(hbr_htmltags_set, "menuitem");
nh_set_str_add(hbr_htmltags_set, "menuitem");
nh_set_str_add(hbr_htmltags_set, "meta");
nh_set_str_add(hbr_htmltags_set, "meter");
nh_set_str_add(hbr_htmltags_set, "multicol");
nh_set_str_add(hbr_htmltags_set, "nav");
nh_set_str_add(hbr_htmltags_set, "nextid");
nh_set_str_add(hbr_htmltags_set, "nobr");
nh_set_str_add(hbr_htmltags_set, "noembed");
nh_set_str_add(hbr_htmltags_set, "noembed");
nh_set_str_add(hbr_htmltags_set, "noframes");
nh_set_str_add(hbr_htmltags_set, "noscript");
nh_set_str_add(hbr_htmltags_set, "object");
nh_set_str_add(hbr_htmltags_set, "ol");
nh_set_str_add(hbr_htmltags_set, "optgroup");
nh_set_str_add(hbr_htmltags_set, "option");
nh_set_str_add(hbr_htmltags_set, "output");
nh_set_str_add(hbr_htmltags_set, "p");
nh_set_str_add(hbr_htmltags_set, "param");
nh_set_str_add(hbr_htmltags_set, "picture");
nh_set_str_add(hbr_htmltags_set, "plaintext");
nh_set_str_add(hbr_htmltags_set, "pre");
nh_set_str_add(hbr_htmltags_set, "progress");
nh_set_str_add(hbr_htmltags_set, "q");
nh_set_str_add(hbr_htmltags_set, "rp");
nh_set_str_add(hbr_htmltags_set, "rt");
nh_set_str_add(hbr_htmltags_set, "rtc");
nh_set_str_add(hbr_htmltags_set, "ruby");
nh_set_str_add(hbr_htmltags_set, "s");
nh_set_str_add(hbr_htmltags_set, "samp");
nh_set_str_add(hbr_htmltags_set, "script");
nh_set_str_add(hbr_htmltags_set, "section");
nh_set_str_add(hbr_htmltags_set, "select");
nh_set_str_add(hbr_htmltags_set, "shadow");
nh_set_str_add(hbr_htmltags_set, "shadow");
nh_set_str_add(hbr_htmltags_set, "slot");
nh_set_str_add(hbr_htmltags_set, "small");
nh_set_str_add(hbr_htmltags_set, "source");
nh_set_str_add(hbr_htmltags_set, "spacer");
nh_set_str_add(hbr_htmltags_set, "span");
nh_set_str_add(hbr_htmltags_set, "strike");
nh_set_str_add(hbr_htmltags_set, "strong");
nh_set_str_add(hbr_htmltags_set, "style");
nh_set_str_add(hbr_htmltags_set, "sub");
nh_set_str_add(hbr_htmltags_set, "summary");
nh_set_str_add(hbr_htmltags_set, "sup");
nh_set_str_add(hbr_htmltags_set, "table");
nh_set_str_add(hbr_htmltags_set, "tbody");
nh_set_str_add(hbr_htmltags_set, "td");
nh_set_str_add(hbr_htmltags_set, "template");
nh_set_str_add(hbr_htmltags_set, "textarea");
nh_set_str_add(hbr_htmltags_set, "tfoot");
nh_set_str_add(hbr_htmltags_set, "th");
nh_set_str_add(hbr_htmltags_set, "thead");
nh_set_str_add(hbr_htmltags_set, "time");
nh_set_str_add(hbr_htmltags_set, "title");
nh_set_str_add(hbr_htmltags_set, "tr");
nh_set_str_add(hbr_htmltags_set, "track");
nh_set_str_add(hbr_htmltags_set, "tt");
nh_set_str_add(hbr_htmltags_set, "tt");
nh_set_str_add(hbr_htmltags_set, "u");
nh_set_str_add(hbr_htmltags_set, "ul");
nh_set_str_add(hbr_htmltags_set, "var");
nh_set_str_add(hbr_htmltags_set, "video");
nh_set_str_add(hbr_htmltags_set, "wbr");
nh_set_str_add(hbr_htmltags_set, "xmp");
}
int hbr_htmltags_check(hb_char_t *tag) {
return nh_set_str_has(hbr_htmltags_set, (char *) tag);
}
#endif // _HDR_HYPERBUILD_RULE_HTMLTAGS

View File

@ -4,166 +4,15 @@
#include "../../ext/nicehash/set/str.h"
#include "../../util/hbchar.h"
// Sourced from https://developer.mozilla.org/en-US/docs/Web/HTML/Element at 2018-07-01T05:55:00Z
static nh_set_str_t hbr_tags_set;
#include "./htmltags.c"
#include "./svgtags.c"
void hbr_tags_init(void) {
hbr_tags_set = nh_set_str_create();
nh_set_str_add(hbr_tags_set, "a");
nh_set_str_add(hbr_tags_set, "abbr");
nh_set_str_add(hbr_tags_set, "acronym");
nh_set_str_add(hbr_tags_set, "address");
nh_set_str_add(hbr_tags_set, "applet");
nh_set_str_add(hbr_tags_set, "applet");
nh_set_str_add(hbr_tags_set, "area");
nh_set_str_add(hbr_tags_set, "article");
nh_set_str_add(hbr_tags_set, "aside");
nh_set_str_add(hbr_tags_set, "audio");
nh_set_str_add(hbr_tags_set, "b");
nh_set_str_add(hbr_tags_set, "basefont");
nh_set_str_add(hbr_tags_set, "bdi");
nh_set_str_add(hbr_tags_set, "bdo");
nh_set_str_add(hbr_tags_set, "bgsound");
nh_set_str_add(hbr_tags_set, "big");
nh_set_str_add(hbr_tags_set, "blink");
nh_set_str_add(hbr_tags_set, "blockquote");
nh_set_str_add(hbr_tags_set, "body");
nh_set_str_add(hbr_tags_set, "br");
nh_set_str_add(hbr_tags_set, "button");
nh_set_str_add(hbr_tags_set, "canvas");
nh_set_str_add(hbr_tags_set, "caption");
nh_set_str_add(hbr_tags_set, "center");
nh_set_str_add(hbr_tags_set, "cite");
nh_set_str_add(hbr_tags_set, "code");
nh_set_str_add(hbr_tags_set, "col");
nh_set_str_add(hbr_tags_set, "colgroup");
nh_set_str_add(hbr_tags_set, "command");
nh_set_str_add(hbr_tags_set, "content");
nh_set_str_add(hbr_tags_set, "content");
nh_set_str_add(hbr_tags_set, "data");
nh_set_str_add(hbr_tags_set, "datalist");
nh_set_str_add(hbr_tags_set, "dd");
nh_set_str_add(hbr_tags_set, "del");
nh_set_str_add(hbr_tags_set, "details");
nh_set_str_add(hbr_tags_set, "dfn");
nh_set_str_add(hbr_tags_set, "dialog");
nh_set_str_add(hbr_tags_set, "dir");
nh_set_str_add(hbr_tags_set, "dir");
nh_set_str_add(hbr_tags_set, "div");
nh_set_str_add(hbr_tags_set, "dl");
nh_set_str_add(hbr_tags_set, "dt");
nh_set_str_add(hbr_tags_set, "element");
nh_set_str_add(hbr_tags_set, "element");
nh_set_str_add(hbr_tags_set, "em");
nh_set_str_add(hbr_tags_set, "embed");
nh_set_str_add(hbr_tags_set, "fieldset");
nh_set_str_add(hbr_tags_set, "figcaption");
nh_set_str_add(hbr_tags_set, "figure");
nh_set_str_add(hbr_tags_set, "font");
nh_set_str_add(hbr_tags_set, "footer");
nh_set_str_add(hbr_tags_set, "form");
nh_set_str_add(hbr_tags_set, "frame");
nh_set_str_add(hbr_tags_set, "frameset");
nh_set_str_add(hbr_tags_set, "h1");
nh_set_str_add(hbr_tags_set, "h2");
nh_set_str_add(hbr_tags_set, "h3");
nh_set_str_add(hbr_tags_set, "h4");
nh_set_str_add(hbr_tags_set, "h5");
nh_set_str_add(hbr_tags_set, "h6");
nh_set_str_add(hbr_tags_set, "header");
nh_set_str_add(hbr_tags_set, "hgroup");
nh_set_str_add(hbr_tags_set, "hr");
nh_set_str_add(hbr_tags_set, "html");
nh_set_str_add(hbr_tags_set, "i");
nh_set_str_add(hbr_tags_set, "iframe");
nh_set_str_add(hbr_tags_set, "image");
nh_set_str_add(hbr_tags_set, "img");
nh_set_str_add(hbr_tags_set, "input");
nh_set_str_add(hbr_tags_set, "ins");
nh_set_str_add(hbr_tags_set, "isindex");
nh_set_str_add(hbr_tags_set, "kbd");
nh_set_str_add(hbr_tags_set, "keygen");
nh_set_str_add(hbr_tags_set, "label");
nh_set_str_add(hbr_tags_set, "legend");
nh_set_str_add(hbr_tags_set, "li");
nh_set_str_add(hbr_tags_set, "link");
nh_set_str_add(hbr_tags_set, "listing");
nh_set_str_add(hbr_tags_set, "main");
nh_set_str_add(hbr_tags_set, "map");
nh_set_str_add(hbr_tags_set, "mark");
nh_set_str_add(hbr_tags_set, "marquee");
nh_set_str_add(hbr_tags_set, "menu");
nh_set_str_add(hbr_tags_set, "menuitem");
nh_set_str_add(hbr_tags_set, "menuitem");
nh_set_str_add(hbr_tags_set, "meta");
nh_set_str_add(hbr_tags_set, "meter");
nh_set_str_add(hbr_tags_set, "multicol");
nh_set_str_add(hbr_tags_set, "nav");
nh_set_str_add(hbr_tags_set, "nextid");
nh_set_str_add(hbr_tags_set, "nobr");
nh_set_str_add(hbr_tags_set, "noembed");
nh_set_str_add(hbr_tags_set, "noembed");
nh_set_str_add(hbr_tags_set, "noframes");
nh_set_str_add(hbr_tags_set, "noscript");
nh_set_str_add(hbr_tags_set, "object");
nh_set_str_add(hbr_tags_set, "ol");
nh_set_str_add(hbr_tags_set, "optgroup");
nh_set_str_add(hbr_tags_set, "option");
nh_set_str_add(hbr_tags_set, "output");
nh_set_str_add(hbr_tags_set, "p");
nh_set_str_add(hbr_tags_set, "param");
nh_set_str_add(hbr_tags_set, "picture");
nh_set_str_add(hbr_tags_set, "plaintext");
nh_set_str_add(hbr_tags_set, "pre");
nh_set_str_add(hbr_tags_set, "progress");
nh_set_str_add(hbr_tags_set, "q");
nh_set_str_add(hbr_tags_set, "rp");
nh_set_str_add(hbr_tags_set, "rt");
nh_set_str_add(hbr_tags_set, "rtc");
nh_set_str_add(hbr_tags_set, "ruby");
nh_set_str_add(hbr_tags_set, "s");
nh_set_str_add(hbr_tags_set, "samp");
nh_set_str_add(hbr_tags_set, "script");
nh_set_str_add(hbr_tags_set, "section");
nh_set_str_add(hbr_tags_set, "select");
nh_set_str_add(hbr_tags_set, "shadow");
nh_set_str_add(hbr_tags_set, "shadow");
nh_set_str_add(hbr_tags_set, "slot");
nh_set_str_add(hbr_tags_set, "small");
nh_set_str_add(hbr_tags_set, "source");
nh_set_str_add(hbr_tags_set, "spacer");
nh_set_str_add(hbr_tags_set, "span");
nh_set_str_add(hbr_tags_set, "strike");
nh_set_str_add(hbr_tags_set, "strong");
nh_set_str_add(hbr_tags_set, "style");
nh_set_str_add(hbr_tags_set, "sub");
nh_set_str_add(hbr_tags_set, "summary");
nh_set_str_add(hbr_tags_set, "sup");
nh_set_str_add(hbr_tags_set, "table");
nh_set_str_add(hbr_tags_set, "tbody");
nh_set_str_add(hbr_tags_set, "td");
nh_set_str_add(hbr_tags_set, "template");
nh_set_str_add(hbr_tags_set, "textarea");
nh_set_str_add(hbr_tags_set, "tfoot");
nh_set_str_add(hbr_tags_set, "th");
nh_set_str_add(hbr_tags_set, "thead");
nh_set_str_add(hbr_tags_set, "time");
nh_set_str_add(hbr_tags_set, "title");
nh_set_str_add(hbr_tags_set, "tr");
nh_set_str_add(hbr_tags_set, "track");
nh_set_str_add(hbr_tags_set, "tt");
nh_set_str_add(hbr_tags_set, "tt");
nh_set_str_add(hbr_tags_set, "u");
nh_set_str_add(hbr_tags_set, "ul");
nh_set_str_add(hbr_tags_set, "var");
nh_set_str_add(hbr_tags_set, "video");
nh_set_str_add(hbr_tags_set, "wbr");
nh_set_str_add(hbr_tags_set, "xmp");
}
int hbr_tags_check(hb_char_t *tag) {
return nh_set_str_has(hbr_tags_set, (char *) tag);
return hbr_htmltags_check(tag) ||
hbr_svgtags_check(tag);
}
#endif // _HDR_HYPERBUILD_RULE_TAGS