Skip to content

Commit 0ea6b3f

Browse files
committed
fix: node.attrs hasKey error
1 parent d8b70fa commit 0ea6b3f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

q.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,10 @@ proc match(n: XmlNode, s: Selector): bool =
9999
if result and s.attributes.len > 0:
100100
for attr in s.attributes:
101101
let value = n.attr(attr.name)
102-
103102
case attr.operator
104103
of '\0':
105104
if attr.value.len == 0: # [attr] match all node has specified attribute, dont care about the value
106-
result = n.attrs.hasKey(attr.name)
105+
result = n.attr(attr.name).len > 0
107106
else: # [attr=value] value must match
108107
result = attr.value == value
109108
of '^':

q.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Package]
22
name = "q"
3-
version = "0.0.5"
3+
version = "0.0.6"
44
author = "Huy Doan"
55
description = "Simple CSS3 selectors for Nim"
66
license = "MIT"

0 commit comments

Comments
 (0)