diff options
author | bptato <nincsnevem662@gmail.com> | 2022-08-03 20:11:57 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-08-03 20:13:50 +0200 |
commit | 46b749e8372b018e73aacc50e908dc96155bcaf8 (patch) | |
tree | b000924d3fd49abe8928ec54880d79b57520a6f8 /src/html | |
parent | 94ca8979ffddda23c645c80ff32ae708206bf94b (diff) | |
download | chawan-46b749e8372b018e73aacc50e908dc96155bcaf8.tar.gz |
Fix incorrect selector parsing, remove httpclient from loader
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/tags.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/html/tags.nim b/src/html/tags.nim index c009b2a5..5e0a2935 100644 --- a/src/html/tags.nim +++ b/src/html/tags.nim @@ -62,6 +62,7 @@ func getInputTypeMap(): Table[string, InputType] = const tagTypeMap = getTagTypeMap() const inputTypeMap = getInputTypeMap() + func tagType*(s: string): TagType = if tagTypeMap.hasKey(s): return tagTypeMap[s] @@ -74,6 +75,14 @@ func inputType*(s: string): InputType = else: return INPUT_UNKNOWN +const tagNameMap = (func(): Table[TagType, string] = + for k, v in tagTypeMap: + result[v] = k +)() + +func tagName*(t: TagType): string = + return tagNameMap[t] + const SelfClosingTagTypes* = { TAG_LI, TAG_P } |