Skip to content

Commit 0b3ce2a

Browse files
authored
Update standard HTML elements. (#149)
Removed: - abc (deprecated) - param (deprecated) - portal (withdrawn proposal) Added: - math (was previously missed) - svg (was previously missed) - video (was previously missed) Closes #145.
1 parent 3e20884 commit 0b3ce2a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/htpy/__init__.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def __getattr__(name: str) -> Element:
2626
return get_element(name)
2727

2828

29-
# https://developer.mozilla.org/en-US/docs/Glossary/Doctype
29+
# The list of HTML elements is mostly collected from
30+
# https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements
3031
html = HTMLElement("html")
3132

32-
# https://developer.mozilla.org/en-US/docs/Glossary/Void_element
3333
area = VoidElement("area")
3434
base = VoidElement("base")
3535
br = VoidElement("br")
@@ -40,18 +40,12 @@ def __getattr__(name: str) -> Element:
4040
input = VoidElement("input")
4141
link = VoidElement("link")
4242
meta = VoidElement("meta")
43-
param = VoidElement("param")
4443
source = VoidElement("source")
4544
track = VoidElement("track")
4645
wbr = VoidElement("wbr")
4746

48-
# Non-deprecated HTML elements, extracted from
49-
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element
50-
# Located via the inspector with:
51-
# Array.from($0.querySelectorAll('li')).filter(x=>!x.querySelector('.icon-deprecated')).map(x => x.querySelector('code').textContent) # noqa: E501
5247
a = Element("a")
5348
abbr = Element("abbr")
54-
abc = Element("abc")
5549
address = Element("address")
5650
article = Element("article")
5751
aside = Element("aside")
@@ -102,6 +96,7 @@ def __getattr__(name: str) -> Element:
10296
main = Element("main")
10397
map = Element("map")
10498
mark = Element("mark")
99+
math = Element("math")
105100
menu = Element("menu")
106101
meter = Element("meter")
107102
nav = Element("nav")
@@ -113,7 +108,6 @@ def __getattr__(name: str) -> Element:
113108
output = Element("output")
114109
p = Element("p")
115110
picture = Element("picture")
116-
portal = Element("portal")
117111
pre = Element("pre")
118112
progress = Element("progress")
119113
q = Element("q")
@@ -134,6 +128,7 @@ def __getattr__(name: str) -> Element:
134128
sub = Element("sub")
135129
summary = Element("summary")
136130
sup = Element("sup")
131+
svg = Element("svg")
137132
table = Element("table")
138133
tbody = Element("tbody")
139134
td = Element("td")
@@ -148,3 +143,4 @@ def __getattr__(name: str) -> Element:
148143
u = Element("u")
149144
ul = Element("ul")
150145
var = Element("var")
146+
video = Element("video")

0 commit comments

Comments
 (0)