summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2020-05-22 11:46:54 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2020-05-22 11:46:54 +0100
commit4d0a0f5290c8dcc31fef17aaed0788bb1309f9bd (patch)
treee2653114a1d8941d4cdf2b1f263fee5b65f054a8
parentd7e13fb32073aac9aba97fa6021da064302fcd72 (diff)
downloadlibhubbub-4d0a0f5290c8dcc31fef17aaed0788bb1309f9bd.tar.gz
libhubbub-4d0a0f5290c8dcc31fef17aaed0788bb1309f9bd.tar.bz2
Treebuilder: Reorganise name_type_map[] src to be easier to change.
-rw-r--r--src/treebuilder/treebuilder.c144
1 files changed, 96 insertions, 48 deletions
diff --git a/src/treebuilder/treebuilder.c b/src/treebuilder/treebuilder.c
index 19f4429..0c171e3 100644
--- a/src/treebuilder/treebuilder.c
+++ b/src/treebuilder/treebuilder.c
@@ -25,58 +25,106 @@ static const struct {
size_t len;
element_type type;
} name_type_map[] = {
- { S("address"), ADDRESS }, { S("area"), AREA },
- { S("base"), BASE }, { S("basefont"), BASEFONT },
- { S("bgsound"), BGSOUND }, { S("blockquote"), BLOCKQUOTE },
- { S("body"), BODY }, { S("br"), BR },
- { S("center"), CENTER }, { S("col"), COL },
- { S("colgroup"), COLGROUP }, { S("dd"), DD },
- { S("dir"), DIR }, { S("div"), DIV },
- { S("dl"), DL }, { S("dt"), DT },
- { S("embed"), EMBED }, { S("fieldset"), FIELDSET },
- { S("form"), FORM }, { S("frame"), FRAME },
- { S("frameset"), FRAMESET }, { S("h1"), H1 },
- { S("h2"), H2 }, { S("h3"), H3 },
- { S("h4"), H4 }, { S("h5"), H5 },
- { S("h6"), H6 }, { S("head"), HEAD },
- { S("hr"), HR }, { S("iframe"), IFRAME },
- { S("image"), IMAGE }, { S("img"), IMG },
- { S("input"), INPUT }, { S("isindex"), ISINDEX },
- { S("li"), LI }, { S("link"), LINK },
+ { S("address"), ADDRESS },
+ { S("area"), AREA },
+ { S("base"), BASE },
+ { S("basefont"), BASEFONT },
+ { S("bgsound"), BGSOUND },
+ { S("blockquote"), BLOCKQUOTE },
+ { S("body"), BODY },
+ { S("br"), BR },
+ { S("center"), CENTER },
+ { S("col"), COL },
+ { S("colgroup"), COLGROUP },
+ { S("dd"), DD },
+ { S("dir"), DIR },
+ { S("div"), DIV },
+ { S("dl"), DL },
+ { S("dt"), DT },
+ { S("embed"), EMBED },
+ { S("fieldset"), FIELDSET },
+ { S("form"), FORM },
+ { S("frame"), FRAME },
+ { S("frameset"), FRAMESET },
+ { S("h1"), H1 },
+ { S("h2"), H2 },
+ { S("h3"), H3 },
+ { S("h4"), H4 },
+ { S("h5"), H5 },
+ { S("h6"), H6 },
+ { S("head"), HEAD },
+ { S("hr"), HR },
+ { S("iframe"), IFRAME },
+ { S("image"), IMAGE },
+ { S("img"), IMG },
+ { S("input"), INPUT },
+ { S("isindex"), ISINDEX },
+ { S("li"), LI },
+ { S("link"), LINK },
{ S("listing"), LISTING },
{ S("menu"), MENU },
- { S("meta"), META }, { S("noembed"), NOEMBED },
- { S("noframes"), NOFRAMES }, { S("noscript"), NOSCRIPT },
- { S("ol"), OL }, { S("optgroup"), OPTGROUP },
- { S("option"), OPTION }, { S("output"), OUTPUT },
- { S("p"), P }, { S("param"), PARAM },
- { S("plaintext"), PLAINTEXT }, { S("pre"), PRE },
- { S("script"), SCRIPT }, { S("select"), SELECT },
- { S("spacer"), SPACER }, { S("style"), STYLE },
- { S("tbody"), TBODY }, { S("textarea"), TEXTAREA },
- { S("tfoot"), TFOOT }, { S("thead"), THEAD },
- { S("title"), TITLE }, { S("tr"), TR },
- { S("ul"), UL }, { S("wbr"), WBR },
- { S("applet"), APPLET }, { S("button"), BUTTON },
- { S("caption"), CAPTION }, { S("html"), HTML },
- { S("marquee"), MARQUEE }, { S("object"), OBJECT },
- { S("table"), TABLE }, { S("td"), TD },
+ { S("meta"), META },
+ { S("noembed"), NOEMBED },
+ { S("noframes"), NOFRAMES },
+ { S("noscript"), NOSCRIPT },
+ { S("ol"), OL },
+ { S("optgroup"), OPTGROUP },
+ { S("option"), OPTION },
+ { S("output"), OUTPUT },
+ { S("p"), P },
+ { S("param"), PARAM },
+ { S("plaintext"), PLAINTEXT },
+ { S("pre"), PRE },
+ { S("script"), SCRIPT },
+ { S("select"), SELECT },
+ { S("spacer"), SPACER },
+ { S("style"), STYLE },
+ { S("tbody"), TBODY },
+ { S("textarea"), TEXTAREA },
+ { S("tfoot"), TFOOT },
+ { S("thead"), THEAD },
+ { S("title"), TITLE },
+ { S("tr"), TR },
+ { S("ul"), UL },
+ { S("wbr"), WBR },
+
+ { S("applet"), APPLET },
+ { S("button"), BUTTON },
+ { S("caption"), CAPTION },
+ { S("html"), HTML },
+ { S("marquee"), MARQUEE },
+ { S("object"), OBJECT },
+ { S("table"), TABLE },
+ { S("td"), TD },
{ S("th"), TH },
- { S("a"), A }, { S("b"), B },
- { S("big"), BIG }, { S("em"), EM },
- { S("font"), FONT }, { S("i"), I },
- { S("nobr"), NOBR }, { S("s"), S },
- { S("small"), SMALL }, { S("strike"), STRIKE },
- { S("strong"), STRONG }, { S("tt"), TT },
- { S("u"), U }, { S("xmp"), XMP },
-
- { S("math"), MATH }, { S("mglyph"), MGLYPH },
- { S("malignmark"), MALIGNMARK },
- { S("mi"), MI }, { S("mo"), MO },
- { S("mn"), MN }, { S("ms"), MS },
- { S("mtext"), MTEXT }, { S("annotation-xml"), ANNOTATION_XML },
- { S("svg"), SVG }, { S("desc"), DESC },
+ { S("a"), A },
+ { S("b"), B },
+ { S("big"), BIG },
+ { S("em"), EM },
+ { S("font"), FONT },
+ { S("i"), I },
+ { S("nobr"), NOBR },
+ { S("s"), S },
+ { S("small"), SMALL },
+ { S("strike"), STRIKE },
+ { S("strong"), STRONG },
+ { S("tt"), TT },
+ { S("u"), U },
+ { S("xmp"), XMP },
+
+ { S("math"), MATH },
+ { S("mglyph"), MGLYPH },
+ { S("malignmark"), MALIGNMARK },
+ { S("mi"), MI },
+ { S("mo"), MO },
+ { S("mn"), MN },
+ { S("ms"), MS },
+ { S("mtext"), MTEXT },
+ { S("annotation-xml"), ANNOTATION_XML },
+
+ { S("svg"), SVG },
+ { S("desc"), DESC },
{ S("foreignobject"), FOREIGNOBJECT },
};