die "Long form arg (name => 'class', value => 'x') is no longer supported"
if(@_ == 1 && $_[0]->{'name'} && $_[0]->{'value'});
-
+
my $opts = ref($_[0]) eq 'HASH' ? $_[0] : {$_[0] => $_[1]};
for (values %{$opts}) { $self->_zconfig->parser->html_escape($_); }
return $opts;
+{ %$evt, raw => undef, raw_attrs => undef,
attrs => {
%$a,
- map {$_ => join(' ', (exists $a->{$_} ? $a->{$_} : ()), $attr->{$_}) }
+ map {$_ => join(' ', (exists $a->{$_} ? $a->{$_} : ()), $attr->{$_}) }
keys %$attr
},
@kadd ? (attr_names => [ @{$evt->{attr_names}}, @kadd ]) : ()
attrs => {
%$a,
#TODO needs to support multiple removes
- map { my $tar = $_; $_ => join ' ',
+ map { my $tar = $_; $_ => join ' ',
map {$attr->{$tar} ne $_} split ' ', $a->{$_} }
grep {exists $a->{$_}} keys %$attr
},
->select('p')
->prepend_content("Hello ")
->to_html
-
+
## <p>Hello World</p>
-
+
Acceptable values are strings, scalar refs and L<HTML::Zoom> objects
=head2 append_content
->select('p')
->prepend_content("World")
->to_html
-
+
## <p>Hello World</p>
Acceptable values are strings, scalar refs and L<HTML::Zoom> objects
}
} @list
]);
-
+
Subroutines would be run with $_ localized to result of L<HTML::Zoom/select> (of
collected elements), and with said result passed as parameter to subroutine.
->stream_from_array(@{$self->html_to_events($text)});
}
+# DO NOT BE AFRAID.
+#
+# Well, ok. Be afraid. A little. But this is lexing HTML with a regexp,
+# not really parsing (since the structure nesting isn't handled here) so
+# it's relatively not dangerous.
+#
+# Certainly it's not really any more or any less heinous than anything else
+# I could do in a handful of lines of pure perl.
+
sub _hacky_tag_parser {
my ($text, $handler) = @_;
$text =~ m{^([^<]*)}g;