#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(u8)]
pub enum Tag {
A,
Abbr,
Address,
Applet,
Area,
Article,
Aside,
Audio,
B,
Base,
Basefont,
Bdi,
Bdo,
Bgsound,
Big,
Blockquote,
Body,
Br,
Button,
Canvas,
Caption,
Center,
Cite,
Code,
Col,
Colgroup,
Data,
Datalist,
Dd,
Del,
Details,
Dfn,
Dialog,
Dir,
Div,
Dl,
Dt,
Em,
Embed,
Fieldset,
Figcaption,
Figure,
Font,
Footer,
Form,
Frame,
Frameset,
H1,
H2,
H3,
H4,
H5,
H6,
Head,
Header,
Hgroup,
Hr,
Html,
I,
Iframe,
Img,
Input,
Ins,
Kbd,
Keygen,
Label,
Legend,
Li,
Link,
Listing,
Main,
Map,
Mark,
Marquee,
Math,
Menu,
Meta,
Meter,
Nav,
Nobr,
Noembed,
Noframes,
Noscript,
Object,
Ol,
Optgroup,
Option,
Output,
P,
Param,
Picture,
Plaintext,
Pre,
Progress,
Q,
Rb,
Rp,
Rt,
Rtc,
Ruby,
S,
Samp,
Script,
Search,
Section,
Select,
Slot,
Small,
Source,
Span,
Strike,
Strong,
Style,
Sub,
Summary,
Sup,
Svg,
Table,
Tbody,
Td,
Template,
Textarea,
Tfoot,
Th,
Thead,
Time,
Title,
Tr,
Track,
Tt,
U,
Ul,
Var,
Video,
Wbr,
Xmp,
Other,
}
impl Tag {
pub fn name(self) -> &'static str {
match self {
Tag::A => "a",
Tag::Abbr => "abbr",
Tag::Address => "address",
Tag::Applet => "applet",
Tag::Area => "area",
Tag::Article => "article",
Tag::Aside => "aside",
Tag::Audio => "audio",
Tag::B => "b",
Tag::Base => "base",
Tag::Basefont => "basefont",
Tag::Bdi => "bdi",
Tag::Bdo => "bdo",
Tag::Bgsound => "bgsound",
Tag::Big => "big",
Tag::Blockquote => "blockquote",
Tag::Body => "body",
Tag::Br => "br",
Tag::Button => "button",
Tag::Canvas => "canvas",
Tag::Caption => "caption",
Tag::Center => "center",
Tag::Cite => "cite",
Tag::Code => "code",
Tag::Col => "col",
Tag::Colgroup => "colgroup",
Tag::Data => "data",
Tag::Datalist => "datalist",
Tag::Dd => "dd",
Tag::Del => "del",
Tag::Details => "details",
Tag::Dfn => "dfn",
Tag::Dialog => "dialog",
Tag::Dir => "dir",
Tag::Div => "div",
Tag::Dl => "dl",
Tag::Dt => "dt",
Tag::Em => "em",
Tag::Embed => "embed",
Tag::Fieldset => "fieldset",
Tag::Figcaption => "figcaption",
Tag::Figure => "figure",
Tag::Font => "font",
Tag::Footer => "footer",
Tag::Form => "form",
Tag::Frame => "frame",
Tag::Frameset => "frameset",
Tag::H1 => "h1",
Tag::H2 => "h2",
Tag::H3 => "h3",
Tag::H4 => "h4",
Tag::H5 => "h5",
Tag::H6 => "h6",
Tag::Head => "head",
Tag::Header => "header",
Tag::Hgroup => "hgroup",
Tag::Hr => "hr",
Tag::Html => "html",
Tag::I => "i",
Tag::Iframe => "iframe",
Tag::Img => "img",
Tag::Input => "input",
Tag::Ins => "ins",
Tag::Kbd => "kbd",
Tag::Keygen => "keygen",
Tag::Label => "label",
Tag::Legend => "legend",
Tag::Li => "li",
Tag::Link => "link",
Tag::Listing => "listing",
Tag::Main => "main",
Tag::Map => "map",
Tag::Mark => "mark",
Tag::Marquee => "marquee",
Tag::Math => "math",
Tag::Menu => "menu",
Tag::Meta => "meta",
Tag::Meter => "meter",
Tag::Nav => "nav",
Tag::Nobr => "nobr",
Tag::Noembed => "noembed",
Tag::Noframes => "noframes",
Tag::Noscript => "noscript",
Tag::Object => "object",
Tag::Ol => "ol",
Tag::Optgroup => "optgroup",
Tag::Option => "option",
Tag::Output => "output",
Tag::P => "p",
Tag::Param => "param",
Tag::Picture => "picture",
Tag::Plaintext => "plaintext",
Tag::Pre => "pre",
Tag::Progress => "progress",
Tag::Q => "q",
Tag::Rb => "rb",
Tag::Rp => "rp",
Tag::Rt => "rt",
Tag::Rtc => "rtc",
Tag::Ruby => "ruby",
Tag::S => "s",
Tag::Samp => "samp",
Tag::Script => "script",
Tag::Search => "search",
Tag::Section => "section",
Tag::Select => "select",
Tag::Slot => "slot",
Tag::Small => "small",
Tag::Source => "source",
Tag::Span => "span",
Tag::Strike => "strike",
Tag::Strong => "strong",
Tag::Style => "style",
Tag::Sub => "sub",
Tag::Summary => "summary",
Tag::Sup => "sup",
Tag::Svg => "svg",
Tag::Table => "table",
Tag::Tbody => "tbody",
Tag::Td => "td",
Tag::Template => "template",
Tag::Textarea => "textarea",
Tag::Tfoot => "tfoot",
Tag::Th => "th",
Tag::Thead => "thead",
Tag::Time => "time",
Tag::Title => "title",
Tag::Tr => "tr",
Tag::Track => "track",
Tag::Tt => "tt",
Tag::U => "u",
Tag::Ul => "ul",
Tag::Var => "var",
Tag::Video => "video",
Tag::Wbr => "wbr",
Tag::Xmp => "xmp",
Tag::Other => "",
}
}
pub fn from_name(name: &str) -> Tag {
match name {
"a" => Tag::A,
"abbr" => Tag::Abbr,
"address" => Tag::Address,
"applet" => Tag::Applet,
"area" => Tag::Area,
"article" => Tag::Article,
"aside" => Tag::Aside,
"audio" => Tag::Audio,
"b" => Tag::B,
"base" => Tag::Base,
"basefont" => Tag::Basefont,
"bdi" => Tag::Bdi,
"bdo" => Tag::Bdo,
"bgsound" => Tag::Bgsound,
"big" => Tag::Big,
"blockquote" => Tag::Blockquote,
"body" => Tag::Body,
"br" => Tag::Br,
"button" => Tag::Button,
"canvas" => Tag::Canvas,
"caption" => Tag::Caption,
"center" => Tag::Center,
"cite" => Tag::Cite,
"code" => Tag::Code,
"col" => Tag::Col,
"colgroup" => Tag::Colgroup,
"data" => Tag::Data,
"datalist" => Tag::Datalist,
"dd" => Tag::Dd,
"del" => Tag::Del,
"details" => Tag::Details,
"dfn" => Tag::Dfn,
"dialog" => Tag::Dialog,
"dir" => Tag::Dir,
"div" => Tag::Div,
"dl" => Tag::Dl,
"dt" => Tag::Dt,
"em" => Tag::Em,
"embed" => Tag::Embed,
"fieldset" => Tag::Fieldset,
"figcaption" => Tag::Figcaption,
"figure" => Tag::Figure,
"font" => Tag::Font,
"footer" => Tag::Footer,
"form" => Tag::Form,
"frame" => Tag::Frame,
"frameset" => Tag::Frameset,
"h1" => Tag::H1,
"h2" => Tag::H2,
"h3" => Tag::H3,
"h4" => Tag::H4,
"h5" => Tag::H5,
"h6" => Tag::H6,
"head" => Tag::Head,
"header" => Tag::Header,
"hgroup" => Tag::Hgroup,
"hr" => Tag::Hr,
"html" => Tag::Html,
"i" => Tag::I,
"iframe" => Tag::Iframe,
"img" => Tag::Img,
"input" => Tag::Input,
"ins" => Tag::Ins,
"kbd" => Tag::Kbd,
"keygen" => Tag::Keygen,
"label" => Tag::Label,
"legend" => Tag::Legend,
"li" => Tag::Li,
"link" => Tag::Link,
"listing" => Tag::Listing,
"main" => Tag::Main,
"map" => Tag::Map,
"mark" => Tag::Mark,
"marquee" => Tag::Marquee,
"math" => Tag::Math,
"menu" => Tag::Menu,
"meta" => Tag::Meta,
"meter" => Tag::Meter,
"nav" => Tag::Nav,
"nobr" => Tag::Nobr,
"noembed" => Tag::Noembed,
"noframes" => Tag::Noframes,
"noscript" => Tag::Noscript,
"object" => Tag::Object,
"ol" => Tag::Ol,
"optgroup" => Tag::Optgroup,
"option" => Tag::Option,
"output" => Tag::Output,
"p" => Tag::P,
"param" => Tag::Param,
"picture" => Tag::Picture,
"plaintext" => Tag::Plaintext,
"pre" => Tag::Pre,
"progress" => Tag::Progress,
"q" => Tag::Q,
"rb" => Tag::Rb,
"rp" => Tag::Rp,
"rt" => Tag::Rt,
"rtc" => Tag::Rtc,
"ruby" => Tag::Ruby,
"s" => Tag::S,
"samp" => Tag::Samp,
"script" => Tag::Script,
"search" => Tag::Search,
"section" => Tag::Section,
"select" => Tag::Select,
"slot" => Tag::Slot,
"small" => Tag::Small,
"source" => Tag::Source,
"span" => Tag::Span,
"strike" => Tag::Strike,
"strong" => Tag::Strong,
"style" => Tag::Style,
"sub" => Tag::Sub,
"summary" => Tag::Summary,
"sup" => Tag::Sup,
"svg" => Tag::Svg,
"table" => Tag::Table,
"tbody" => Tag::Tbody,
"td" => Tag::Td,
"template" => Tag::Template,
"textarea" => Tag::Textarea,
"tfoot" => Tag::Tfoot,
"th" => Tag::Th,
"thead" => Tag::Thead,
"time" => Tag::Time,
"title" => Tag::Title,
"tr" => Tag::Tr,
"track" => Tag::Track,
"tt" => Tag::Tt,
"u" => Tag::U,
"ul" => Tag::Ul,
"var" => Tag::Var,
"video" => Tag::Video,
"wbr" => Tag::Wbr,
"xmp" => Tag::Xmp,
_ => Tag::Other,
}
}
}