From: Arthur Axel 'fREW' Schmidt Date: Mon, 12 Apr 2010 05:45:18 +0000 (-0500) Subject: E[attr*="foo"] X-Git-Tag: release_0.009004~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=7084f73fe418998647664323a2d1b77c8e6c7e71 E[attr*="foo"] --- diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index 32688fc..9b3d5dc 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