From: Arthur Axel 'fREW' Schmidt Date: Mon, 12 Apr 2010 05:44:11 +0000 (-0500) Subject: E[attr$="foo"] X-Git-Tag: release_0.009004~58 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74a46830869136ae0d00610c6dfda53ce149211f;p=catagits%2FHTML-Zoom.git E[attr$="foo"] --- diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index 3395940..32688fc 100644 --- a/lib/HTML/Zoom/SelectorParser.pm +++ b/lib/HTML/Zoom/SelectorParser.pm @@ -50,6 +50,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