X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FSelectorParser.pm;h=c485da40bdfeaa1415b4339bde60ac030ffdabfd;hb=32ea0d1e04c5ece6a425bed0339995986dd93eef;hp=007b2501216d1941f70103dd638096516d0a5302;hpb=7871f2ffebae6e6cf2028cdca655049e0a034d8c;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom/SelectorParser.pm b/lib/HTML/Zoom/SelectorParser.pm index 007b250..c485da4 100644 --- a/lib/HTML/Zoom/SelectorParser.pm +++ b/lib/HTML/Zoom/SelectorParser.pm @@ -58,6 +58,18 @@ sub _raw_parse_simple_selector { } }; + # 'el#id' - element + id + + /\G$sel_re#$sel_re/gc and + return do { + my $id = $1; + my $name = $2; + sub { + $_[0]->{name} && $_[0]->{name} eq $name and + $_[0]->{attrs}{id} && $_[0]->{attrs}{id} eq $id + } + }; + confess "Couldn't parse $_ as starting with simple selector"; } }