about summary refs log tree commit diff stats
path: root/src/buffer
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-01-03 04:03:59 +0100
committerbptato <nincsnevem662@gmail.com>2023-01-03 04:03:59 +0100
commitade7206183ba1ea22c6b3d8c1f02deb489019e69 (patch)
treeadd4dd4a33dac26c15dc538fde455f5847aa6d81 /src/buffer
parent222487b3a20dd18a3f024249a2cb90d00ce535bd (diff)
downloadchawan-ade7206183ba1ea22c6b3d8c1f02deb489019e69.tar.gz
buffer: fix infinite loop
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/buffer.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim
index 34674062..f54158e1 100644
--- a/src/buffer/buffer.nim
+++ b/src/buffer/buffer.nim
@@ -263,8 +263,9 @@ func getClickable(styledNode: StyledNode): Element =
     let element = Element(styledNode.node)
     if element.tagType in ClickableElements and (element.tagType != TAG_A or HTMLAnchorElement(element).href != ""):
       return element
+  result = styledNode.node
   while true:
-    result = styledNode.node.findAncestor(ClickableElements)
+    result = result.findAncestor(ClickableElements)
     if result == nil:
       break
     if result.tagType != TAG_A or HTMLAnchorElement(result).href != "":