about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-08-03 20:11:57 +0200
committerbptato <nincsnevem662@gmail.com>2022-08-03 20:13:50 +0200
commit46b749e8372b018e73aacc50e908dc96155bcaf8 (patch)
treeb000924d3fd49abe8928ec54880d79b57520a6f8 /src/html
parent94ca8979ffddda23c645c80ff32ae708206bf94b (diff)
downloadchawan-46b749e8372b018e73aacc50e908dc96155bcaf8.tar.gz
Fix incorrect selector parsing, remove httpclient from loader
Diffstat (limited to 'src/html')
-rw-r--r--src/html/tags.nim9
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
 }