From 18cc08659a1c62f85fedc8177460762c6ce73d0e Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Thu, 5 Jul 2018 23:57:36 +1200 Subject: [PATCH] Specific tags --- src/main/c/rule/tag/specifictags.c | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/c/rule/tag/specifictags.c diff --git a/src/main/c/rule/tag/specifictags.c b/src/main/c/rule/tag/specifictags.c new file mode 100644 index 0000000..5f5d888 --- /dev/null +++ b/src/main/c/rule/tag/specifictags.c @@ -0,0 +1,34 @@ +#ifndef _HDR_HYPERBUILD_RULE_SPECIFICTAGS +#define _HDR_HYPERBUILD_RULE_SPECIFICTAGS + +#include "../../ext/nicehash/set/str.h" +#include "../../util/hbchar.h" +#include "./sectioningtags.c" + +static nh_set_str_t hb_r_specifictags_set; + +void hb_r_specifictags_add_elems(nh_set_str_t set) { + nh_set_str_add(set, "area"); + nh_set_str_add(set, "br"); + nh_set_str_add(set, "col"); + nh_set_str_add(set, "embed"); + nh_set_str_add(set, "hr"); + nh_set_str_add(set, "img"); + nh_set_str_add(set, "input"); + nh_set_str_add(set, "param"); + nh_set_str_add(set, "pre"); // Reason: unlikely to want to minify + nh_set_str_add(set, "script"); + nh_set_str_add(set, "source"); + nh_set_str_add(set, "track"); +} + +void hb_r_specifictags_init(void) { + hb_r_specifictags_set = nh_set_str_create(); + hb_r_specifictags_add_elems(hb_r_specifictags_set); +} + +int hb_r_specifictags_check(hb_char_t *tag) { + return nh_set_str_has(hb_r_specifictags_set, (char *) tag); +} + +#endif // _HDR_HYPERBUILD_RULE_SPECIFICTAGS