From cd79d48d9799b715188a63461f2023eb4187ad39 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 14 Dec 2013 15:43:30 +0000 Subject: Consider attributes when matching elements --- lib/html-paths.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/html-paths.js') diff --git a/lib/html-paths.js b/lib/html-paths.js index 9ecb6dd..d2456c2 100644 --- a/lib/html-paths.js +++ b/lib/html-paths.js @@ -41,7 +41,7 @@ function Element(tagName, attributes, options) { } Element.prototype.matchesElement = function(element) { - return this.tagNames[element.tagName]; + return this.tagNames[element.tagName] && _.isEqual(this.attributes || {}, element.attributes || {}); } -- cgit v1.2.3