From: Arthur Axel 'fREW' Schmidt Date: Mon, 12 Apr 2010 05:45:18 +0000 (-0500) Subject: E[attr*="foo"] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=827f965ba419e87fc4e0ab01b9f4ed7cf150d2e4;p=catagits%2FHTML-Zoom.git E[attr*="foo"] --- diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index 8e02a7d..fb4bcd3 100644 --- a/lib/HTML/Zoom/SelectorParser.pm +++ b/lib/HTML/Zoom/SelectorParser.pm @@ -63,6 +63,19 @@ sub _raw_parse_simple_selector { } }; + # 'el[attr*="foo"] + + /\G$sel_re\[$sel_re\*="$sel_re"\]/gc and + return do { + my $name = $1; + my $attr = $2; + my $val = $3; + sub { + $_[0]->{name} && $_[0]->{name} eq $name and + $_[0]->{attrs}{$attr} && $_[0]->{attrs}{$attr} =~ /\Q$val\E/ + } + }; + # 'el[attr="foo"] /\G$sel_re\[$sel_re="$sel_re"\]/gc and