about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-17 23:26:18 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-17 23:26:18 +0200
commit19989f9f0a2845bd6a8fe21db3689f1cd91a8a5a (patch)
treed90f6b6886b11094dce21dc2ade81e5aaf60ac69 /src/html
parent9cf21945449596aa7632a583bc9b2fd211d4cf5e (diff)
downloadchawan-19989f9f0a2845bd6a8fe21db3689f1cd91a8a5a.tar.gz
Fix another parser bug
Diffstat (limited to 'src/html')
-rw-r--r--src/html/htmlparser.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/html/htmlparser.nim b/src/html/htmlparser.nim
index b46a3dfa..92e264ff 100644
--- a/src/html/htmlparser.nim
+++ b/src/html/htmlparser.nim
@@ -202,9 +202,10 @@ func createElement(parser: HTML5Parser, token: Token, namespace: Namespace, inte
       not parser.openElements.hasElement(TAG_TEMPLATE) and
       (element.tagType notin ListedElements or not element.attrb("form")) and
       intendedParent.inSameTree(parser.form):
-    let element = FormAssociatedElement(element)
-    element.setForm(parser.form)
-    element.parserInserted = true
+    if element.tagType in {TAG_SELECT, TAG_INPUT}: #TODO implement the other ones too
+      let element = FormAssociatedElement(element)
+      element.setForm(parser.form)
+      element.parserInserted = true
   return element
 
 proc insert(location: AdjustedInsertionLocation, node: Node) =