about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-04-30 16:29:02 +0200
committerbptato <nincsnevem662@gmail.com>2023-04-30 16:29:02 +0200
commit234160fd86fb66b637d060de58ee7d5b8d8daabc (patch)
tree6cdb1d17e6e8d40c17d1a9ac534ae5a07789f2a3 /src/html
parent05b64a1d8fa95381d756231f665c0b8c79787b67 (diff)
downloadchawan-234160fd86fb66b637d060de58ee7d5b8d8daabc.tar.gz
dom: fix one-off error in insertNode
This caused the last child node to not be copied.
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index bc09ec35..3b01b14e 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -1846,8 +1846,7 @@ proc insertNode(parent, node, before: Node) =
     node.index = parent.childList.high
   else:
     node.index = before.index
-    eprint "index", node.index
-    for i in before.index ..< parent.childList.len - 2:
+    for i in before.index ..< parent.childList.len - 1:
       parent.childList[i + 1] = parent.childList[i]
       parent.childList[i + 1].index = i + 1
   parent.childList[node.index] = node