Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Last active September 2, 2019 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhodgins/867fd8d0486d0fedae0b949e4b97fafc to your computer and use it in GitHub Desktop.
Save tomhodgins/867fd8d0486d0fedae0b949e4b97fafc to your computer and use it in GitHub Desktop.
Run this snippet in the browser's JS console, or on the CLI via Deno to list HTML tags
// Run this snippet in the browser's JS console, or via Deno to list HTML tags Chrome parses
const JSON5 = {
parse: string => new Function(`return ${string}`)()
}
fetch('https://raw.githubusercontent.com/chromium/chromium/master/third_party/blink/renderer/core/html/html_tag_names.json5')
.then(response => response.text())
.then(text => JSON5.parse(text)) /* lol */
.then(({data}) => console.log(
data.map(item => item.name ? item.name : item)
))
fetch('https://raw.githubusercontent.com/mozilla/gecko-dev/master/parser/htmlparser/nsElementTable.cpp')
.then(response => response.text())
.then(text => console.log(
text
.match(/ ELEM\(([^,]+),/g)
.map(string => string.replace(/ ELEM\(([^,]+),/g, '$1'))
))
[
"unknown",
"a",
"abbr",
"acronym",
"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",
"image",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"legend",
"li",
"link",
"listing",
"main",
"map",
"mark",
"marquee",
"menu",
"menuitem",
"meta",
"meter",
"multicol",
"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",
"section",
"select",
"small",
"slot",
"source",
"span",
"strike",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"template",
"time",
"title",
"tr",
"track",
"tt",
"u",
"ul",
"var",
"video",
"wbr",
"xmp",
"text",
"whitespace",
"newline",
"comment",
"entity",
"doctypeDecl",
"markupDecl",
"instruction",
"userdefined"
]
[
"a",
"abbr",
"acronym",
"address",
"applet",
"area",
"article",
"aside",
"audio",
"b",
"base",
"basefont",
"bdi",
"bdo",
"bgsound",
"big",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"center",
"cite",
"code",
"col",
"colgroup",
"command",
"content",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dir",
"dialog",
"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",
"image",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"layer",
"legend",
"li",
"link",
"listing",
"main",
"map",
"mark",
"marquee",
"menu",
"meta",
"meter",
"nav",
"nobr",
"noembed",
"noframes",
"nolayer",
"object",
"ol",
"optgroup",
"option",
"output",
"shadow",
"p",
"param",
"picture",
"plaintext",
"portal",
"pre",
"progress",
"q",
"rb",
"rp",
"rt",
"rtc",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"slot",
"small",
"source",
"span",
"strike",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"template",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"tt",
"u",
"ul",
"var",
"video",
"wbr",
"xmp",
"noscript"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment