Comparing version 0.3.6 to 0.4.0
@@ -142,3 +142,3 @@ var through = require('through'); | ||
pseudo: s.match(/:([\w-]+)/), | ||
attribute: s.match(/\[([^\]]+)\]/), | ||
attribute: s.match(/\[([^\]]+)=([^\]]+)\]/), | ||
}; | ||
@@ -151,3 +151,3 @@ | ||
pseudo: m.pseudo && m.pseudo[1], | ||
attribute: m.attribute && m.attribute[1], | ||
attribute: m.attribute && m.attribute.slice(1), | ||
}; | ||
@@ -181,2 +181,7 @@ }).filter(Boolean); | ||
if (p.id && p.id !== t.attributes.id) return false; | ||
if (p.attribute) { | ||
if (t.attributes[p.attribute[0]] !== p.attribute[1]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
@@ -183,0 +188,0 @@ } |
{ | ||
"name" : "trumpet", | ||
"version" : "0.3.6", | ||
"version" : "0.4.0", | ||
"description" : "parse and transform streaming html using css selectors", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
@@ -6,3 +6,3 @@ var test = require('tap').test; | ||
test('select', function (t) { | ||
t.plan(6); | ||
t.plan(7); | ||
@@ -50,2 +50,8 @@ var tr = trumpet(); | ||
}); | ||
tr.select('div[class=g]', function (node) { | ||
node.html(function (html) { | ||
t.equal(html, 'sup'); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37069
800
260