module HtmlTags where import Data.Ix {- | This is an enumeration type of all the tags that are allowed in HTML documents. HTML document containing tags that are not included in this enumeration can still be represented, thanks to the constructor 'Html.HtmlGarbage' in the 'Html.HtmlItem' type. -} data TagName -- Head tags = TITLE | ISINDEX | META | LINK | BASE | SCRIPT | STYLE -- ISINDEX is also a block tag | NEXTID -- non-standard -- Block tags | H1 | H2 | H3 | H4 | H5 | H6 | UL | OL | DIR | MENU | DL | P | PRE | BLOCKQUOTE | DIV | CENTER | FORM | HR | TABLE | ADDRESS -- New HTML 5 block tags, see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/HTML5_element_list | MAIN | ARTICLE | ASIDE | DETAILS | FIGCAPTION | FIGURE | FOOTER | HEADER | HGROUP | NAV | SECTION -- New HTML 4.0 block tags: | NOSCRIPT -- Logical tags | EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE -- Physical tags | TT | I | B | U | STRIKE | BIG | SMALL | SUB | SUP -- Special inline tags | A | BASEFONT | IMG | APPLET | FONT | BR | MAP | NOBR -- Netscape extension? | BLINK -- HTML 5: | METER | TIME | MARK | BDI | PICTURE | AUDIO | VIDEO | SOURCE | EMBED | CANVAS | SVG | MATH -- HTML 4.0: | S | Q | ABBR | ACRONYM | SPAN -- !! These are actually allowed both as block and inline elems: | DEL | INS | IFRAME | OBJECT -- Other tags | LI | DT | DD | INPUT | SELECT | TEXTAREA | OPTION | LABEL | BUTTON | CAPTION | THEAD | TFOOT | TBODY | TR | TH | TD | AREA | PARAM | HTML | HEAD | BODY -- Nonstandard tags: | FRAMESET | FRAME | NOFRAMES | PLAINTEXT | SANS | LISTING | FUPPLET -- WWWBrowser | MULTICOL -- Netscape --} deriving (Eq,Show,Ord,Enum,Bounded,Ix) allTags = [minBound .. maxBound] :: [TagName] blockTagRange = (H1,NOSCRIPT) isBlockTag = inRange blockTagRange --isBlockTag b = H1<=b && b<=NOSCRIPT