substack/node-trumpet — pull request #18 by Maff- (2013-08-26 15:48:34+00:00)
Title: Attribute Selectors Tests and Substring Matching

Sorry for not checking with you first if would accept such a feature addition. I could use this for a project anyway, but if it could be implemented upstream that would be great.

It adds the CSS3 [Substring matching attribute selectors](http://www.w3.org/TR/css3-selectors/#attribute-substrings) `[attr^=val]`, `[attr$=val]`, `[attr*=val]`

```
ok test/article.js ...................................... 3/3
ok test/attribute_selectors.js ........................ 14/14
ok test/child.js ........................................ 4/4
ok test/comment.js ...................................... 3/3
ok test/descendant.js ................................... 3/3
ok test/get_attr.js ..................................... 5/5
ok test/link.js ......................................... 2/2
ok test/loud.js ......................................... 2/2
ok test/misc_tags.js .................................... 6/6
ok test/multi_stream.js ................................. 8/8
ok test/overlapping_reads.js ............................ 4/4
ok test/read_stream.js ................................ 20/20
ok test/rebase.js ..................................... 11/11
ok test/rm_attr.js ...................................... 2/2
ok test/script_tr.js .................................... 3/3
ok test/set_attr.js ..................................... 3/3
ok test/sibling.js ...................................... 3/3
ok test/through_stream.js ............................... 3/3
ok test/triple_through_stream.js ........................ 2/2
ok test/write_stream.js ................................. 3/3
total ............................................... 104/104

ok
```

P.S. The selector naming might not be ideal, but begins/contains were already in use.