-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelements.lua
154 lines (153 loc) · 4.51 KB
/
elements.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
--All valid elements in html5
--format: {tagName, void=isVoidElement, global=globalName}
-- void is used for void elements, which are not allowed to have
-- closing tags
-- global is used to give a custom name for an element. This is used
-- for table, because the element table clashes with the lua global
return {
{'html', attributes={'manifest'}},
{'head'},
{'title'},
{'base',void=true, attributes={'href', 'target'}},
{'link',void=true, attributes={'href','crossorigin','red','media','hreflang','type','sizes'}},
{'meta',void=true, attributes={'name','http-equiv','content','charset'}},
{'style', attributes={'media','type'}},
{'script', attributes={'src','type','charset','async','defer','crossorigin'}},
{'noscript'},
{'template'},
{'body', attributes={'onafterprint','onbeforeprint','onbeforeunload','onhashchange','onmessage','onoffline','ononline','onpagehide','onpageshow','onpopstate','onstorage','onunload'}},
{'section'},
{'nav'},
{'article'},
{'aside'},
{'h1'},
{'h2'},
{'h3'},
{'h4'},
{'h5'},
{'h6'},
{'header'},
{'footer'},
{'address'},
{'main'},
{'p'},
{'hr',void=true},
{'pre'},
{'blockquote', attributes={'cite'}},
{'ol', attributes={'reversed','start','type'}},
{'ul'},
{'li', attributes={'value'}},
{'dl'},
{'dt'},
{'dd'},
{'figure'},
{'figcaption'},
{'div'},
{'a', attributes={'href','target','download','rel','hreflang','type'}},
{'em'},
{'strong'},
{'small'},
{'small'},
{'s'},
{'cite'},
{'q', attributes={'cite'}},
{'dfn'},
{'abbr'},
{'data', attributes={'value'}},
{'time', attributes={'datetime'}},
{'code'},
{'var'},
{'samp'},
{'kbd'},
{'sub'},
{'sup'},
{'i'},
{'b'},
{'u'},
{'mark'},
{'ruby'},
{'rt'},
{'rp'},
{'bdi'},
{'bdo'},
{'span'},
{'br',void=true},
{'wbr',void=true},
{'ins', attributes={'cite','datetime'}},
{'del', attributes={'cite','datetime'}},
{'img',void=true, attributes={'alt','src','crossorigin','usemap','ismap','width','height'}},
{'iframe',attributes={'src','srcdoc','name','sandbox','width','height'}},
{'embed',void=true, attributes={'src','type','width','height'}},
{'object',attributes={'data','type','typemustmatch','name','usemap','form','width','height'}},
{'param',void=true, attributes={'name','value'}},
{'video', attributes={'src','crossorigin','poster','preload','autoplay','mediagroup','loop','muted','controls','width','height'}},
{'audio',attributes={'src','crossorigin','preload','autoplay','mediagroup','loop','muted','controls'}},
{'source',void=true, attributes={'src','type','media'}},
{'track',void=true, attributes={'kind','src','srclang','label','default'}},
{'canvas', attributes={'width','height'}},
{'map', attributes={'name'}},
{'area',void=true, attributes={'alt','coords','shape','href','target','download','rel','hreflang','type'}},
{'svg'},
{'math'},
{'table',global='tab'},
{'caption'},
{'colgroup', attributes={'span'}},
{'col',void=true, attributes={'span'}},
{'tbody'},
{'thead'},
{'tfoot'},
{'tr'},
{'td', attributes={'colspan','rowspan','headers'}},
{'th', attributes={'colspan','rowspan','headers','scope','abbr'}},
{'form', attributes={'accept-charset','autocomplete','action','enctype','method','name','novalidate','target'}},
{'fieldset', attributes={'disabled','form','name'}},
{'legend'},
{'label', attributes={'for','form'}},
{'input',void=true, attributes={
"accept",
"alt",
"autocomplete",
"autofocus",
"checked",
"dirname",
"disabled",
"form",
"formaction",
"formenctype",
"formmethod",
"formnovalidate",
"formtarget",
"height",
"list",
"max",
"maxlength",
"min",
"minlength",
"multiple",
"name",
"pattern",
"placeholder",
"readonly",
"required",
"size",
"src",
"step",
"type",
"value",
"width",
}},
{'button', attributes={'autofocus','disabled','form','formaction','formenctype','formmethod','formnovalidate','formtarget','name','type','value',}},
{'select', attributes={'autofocus','disabled','form','multiple','required','name','value',}},
{'datalist'},
{'optgroup', attributes={'disabled','label'}},
{'option',attributes={'disabled','label','selected','value'}},
{'textarea', attributes={"autocomplete","autofocus","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap",}},
{'keygen',void=true, attributes={'autofocus','challenge','disabled','form','keytype','name'}},
{'output', attributes={'for','form','name'}},
{'progress', attributes={'value','max'}},
{'meter', attributes={'value','min','max','low','high','optimum'}},
{'details'},
{'summary'},
{'menuitem'},
{'menu'}
}