+0.009008 2013-02-28
+ - Several patches for incorrect functionality (thanks to Jim Miner &
+ stratman@gmail.com) :-
+
+ - Don't throw away leading PCDATA in $text, in _hacky_tag_parser().
+ This is important so we can use from_html and replace_content to
+ insert fragments with or without markup into templates.
+
+ - Fix matching against attribute value "0" (zero) or "" (empty).
+
+ - Fix parsing of selectors matching against attribute value "" (empty).
+ (This does not fix parsing of single-quoted attribute values.)
+
+0.009007 2013-02-24
+ - Remove long form ( name, value ) for attributes to set_attribute / add_attribute
+ to allow future enhancements (selector in options).
+
0.009006 2011-05-20
- Add DESTROY method to fix test failures / warnings in perl >= 5.13.1
+++ /dev/null
-use strict;
-use warnings FATAL => 'all';
-use 5.008001;
-use ExtUtils::MakeMaker;
-
-(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
-
-WriteMakefile(
- NAME => 'HTML-Zoom',
- VERSION_FROM => 'lib/HTML/Zoom.pm',
- PREREQ_PM => { strictures => 1, 'Test::More' => '0.88' },
- test => { TESTS => 't/*.t t/*/*.t' },
-);
my $sel_char = '-\w_';
my $sel_meta_char = q-!"#$%&'()*+,./:;<=>?@[\]^`{|}~-;
-my $sel_re = qr/((?:(?:\\[\Q$sel_meta_char\E])|[$sel_char])+)/;
-my $match_value_re = qr/"?$sel_re"?/;
+my $sel_item = qr/(?:(?:\\[\Q$sel_meta_char\E])|[$sel_char])/;
+my $sel_re = qr/($sel_item+)/;
+my $match_value_re = qr/"?($sel_item*)"?/;
sub new { bless({}, shift) }
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} =~ qr/^\Q$value\E/;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} =~ qr/\Q$value\E$/;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} =~ qr/\Q$value\E/;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} =~ qr/\b\Q$value\E\b/;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} =~ qr/^\Q$value\E(?:-|$)/;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- $_[0]->{attrs}{$attribute}
+ exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} eq $value;
}
};
my $attribute = $_[0]->_unescape($1);
my $value = $_[0]->_unescape($2);
sub {
- ! ($_[0]->{attrs}{$attribute}
+ ! (exists $_[0]->{attrs}{$attribute}
&& $_[0]->{attrs}{$attribute} eq $value);
}
};