diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-03 04:06:49 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-03 04:07:21 +0100 |
commit | a55be67a650d049d01b70514f94fe8ad409f770c (patch) | |
tree | d8941f04a3c9b9987d07eb135c9a92b9723796e5 /src/buffer | |
parent | ade7206183ba1ea22c6b3d8c1f02deb489019e69 (diff) | |
download | chawan-a55be67a650d049d01b70514f94fe8ad409f770c.tar.gz |
buffer: fix infinite loop in getClickable
Diffstat (limited to 'src/buffer')
-rw-r--r-- | src/buffer/buffer.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index f54158e1..51c09616 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -263,13 +263,14 @@ 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 + var node = styledNode.node while true: - result = result.findAncestor(ClickableElements) + result = node.findAncestor(ClickableElements) if result == nil: break if result.tagType != TAG_A or HTMLAnchorElement(result).href != "": break + node = result func getClickHover(styledNode: StyledNode): string = let clickable = styledNode.getClickable() |