about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-17 01:40:51 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-17 01:40:51 +0100
commit7c227f8160abfbde62437aedae1c144c257aacca (patch)
treed1760779ec9a13e0286b5fccf55dc6770044499d /src/html
parente8ab10d39ed89ea1f29f7b3d1de2e7918e28a42f (diff)
downloadchawan-7c227f8160abfbde62437aedae1c144c257aacca.tar.gz
dom: fix innerHTML tag name regression
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index bf5c882b..1a1913b1 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -1841,7 +1841,10 @@ func serializeFragmentInner(child: Node, parentType: TagType): string =
     let element = Element(child)
     result &= '<'
     #TODO qualified name if not HTML, SVG or MathML
-    result &= element.localName
+    if element.tagType == TAG_UNKNOWN:
+      result &= element.localName
+    else:
+      result &= tagName(element.tagType)
     #TODO custom elements
     for k, v in element.attrs:
       #TODO namespaced attrs
@@ -1849,7 +1852,10 @@ func serializeFragmentInner(child: Node, parentType: TagType): string =
     result &= '>'
     result &= element.serializeFragment()
     result &= "</"
-    result &= element.localName
+    if element.tagType == TAG_UNKNOWN:
+      result &= element.localName
+    else:
+      result &= tagName(element.tagType)
     result &= '>'
   elif child of Text:
     let text = Text(child)