-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. The void_elements were identically defined in two different files. This PR moves them to 1 file. 2. Better to define the element names in a table and loop over that table to create the elements (exploiting globals()) rather than use explicit code per element.
- Loading branch information
1 parent
47165fc
commit 5df28ae
Showing
3 changed files
with
134 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
# https://developer.mozilla.org/en-US/docs/Glossary/Void_element | ||
void_elements = ( | ||
"area", | ||
"base", | ||
"br", | ||
"col", | ||
"embed", | ||
"hr", | ||
"img", | ||
"input", | ||
"link", | ||
"meta", | ||
"param", | ||
"source", | ||
"track", | ||
"wbr", | ||
) | ||
|
||
# Non-deprecated HTML elements, extracted from | ||
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element Located via | ||
# the inspector with: | ||
# Array.from($0.querySelectorAll('li')).filter(x=>!x.querySelector('.icon-deprecated')).map(x | ||
# => x.querySelector('code').textContent) # noqa: E501 | ||
elements = ( | ||
"a", | ||
"abbr", | ||
"abc", | ||
"address", | ||
"article", | ||
"aside", | ||
"audio", | ||
"b", | ||
"bdi", | ||
"bdo", | ||
"blockquote", | ||
"body", | ||
"button", | ||
"canvas", | ||
"caption", | ||
"cite", | ||
"code", | ||
"colgroup", | ||
"data", | ||
"datalist", | ||
"dd", | ||
"del_", | ||
"details", | ||
"dfn", | ||
"dialog", | ||
"div", | ||
"dl", | ||
"dt", | ||
"em", | ||
"fieldset", | ||
"figcaption", | ||
"figure", | ||
"footer", | ||
"form", | ||
"h1", | ||
"h2", | ||
"h3", | ||
"h4", | ||
"h5", | ||
"h6", | ||
"head", | ||
"header", | ||
"hgroup", | ||
"i", | ||
"iframe", | ||
"ins", | ||
"kbd", | ||
"label", | ||
"legend", | ||
"li", | ||
"main", | ||
"map", | ||
"mark", | ||
"menu", | ||
"meter", | ||
"nav", | ||
"noscript", | ||
"object", | ||
"ol", | ||
"optgroup", | ||
"option", | ||
"output", | ||
"p", | ||
"picture", | ||
"portal", | ||
"pre", | ||
"progress", | ||
"q", | ||
"rp", | ||
"rt", | ||
"ruby", | ||
"s", | ||
"samp", | ||
"script", | ||
"search", | ||
"section", | ||
"select", | ||
"slot", | ||
"small", | ||
"span", | ||
"strong", | ||
"style", | ||
"sub", | ||
"summary", | ||
"sup", | ||
"table", | ||
"tbody", | ||
"td", | ||
"template", | ||
"textarea", | ||
"tfoot", | ||
"th", | ||
"thead", | ||
"time", | ||
"title", | ||
"tr", | ||
"u", | ||
"ul", | ||
"var", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters