projects
/
catagits/HTML-Zoom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
apply_if doc
[catagits/HTML-Zoom.git]
/
lib
/
HTML
/
Zoom.pm
diff --git
a/lib/HTML/Zoom.pm
b/lib/HTML/Zoom.pm
index
6ac8085
..
df4d3a0
100644
(file)
--- a/
lib/HTML/Zoom.pm
+++ b/
lib/HTML/Zoom.pm
@@
-686,6
+686,14
@@
sugar, the following is entirely equivalent:
my $z2 = $sub->($z1);
+=head2 apply_if
+
+ my $z2 = $z1->apply_if($cond, sub {
+ $_->select('div')->replace_content('I AM A DIV!') })
+ });
+
+->apply but will only run the tranform if $cond is true
+
=head2 to_html
my $html = $zoom->to_html;