-
Notifications
You must be signed in to change notification settings - Fork 0
/
elem_config.lua
58 lines (53 loc) · 1.67 KB
/
elem_config.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
local config = {}
-- ref: https://html.spec.whatwg.org/#elements-2
config.HTML_ELEMS = {} ---@type table<string, true>
do
local list = { ---@type string[]
'a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio',
'b', 'base', 'bdi', 'bdo', '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',
'fencedframe', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html',
'i', 'iframe', 'img', 'input', 'ins',
'kbd',
'label', 'legend', 'li', 'link',
'main', 'map', 'mark', 'marquee', 'menu', 'meta', 'meter',
'nav', 'nobr', 'noembed', 'noframes', 'noscript',
'object', 'ol', 'optgroup', 'option', 'output',
'p', 'param', 'picture', 'plaintext', 'portal', 'pre', 'progress',
'q',
'rb', 'rp', 'rt', 'rtc', 'ruby',
's', 'samp', 'script', 'search', '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',
}
local dict = config.HTML_ELEMS
for _, tag in pairs(list) do
dict[tag] = true
end
end
config.VOID_ELEMS = {
area = true,
base = true,
br = true,
col = true,
embed = true,
hr = true,
img = true,
input = true,
link = true,
meta = true,
param = true,
source = true,
track = true,
wbr = true,
}
config.RAW_TEXT_ELEMS = {
script = true, style = true,
}
return config