diff options
author | bptato <nincsnevem662@gmail.com> | 2023-04-30 16:29:02 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-04-30 16:29:02 +0200 |
commit | 234160fd86fb66b637d060de58ee7d5b8d8daabc (patch) | |
tree | 6cdb1d17e6e8d40c17d1a9ac534ae5a07789f2a3 /src/html | |
parent | 05b64a1d8fa95381d756231f665c0b8c79787b67 (diff) | |
download | chawan-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.nim | 3 |
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 |