X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FHTML%2FElement%2FLibrary.pm;h=cb9cec3e5d423454e19e29c82f24e38ef3bbe48e;hb=271d5078dc10f92db0d9927bd84065a0b9a38397;hp=024e114e441a0878ee698adccfc8125bc0a11324;hpb=ce4e9192aee74dad8e8131803f127f66ee3a1c3b;p=html-element-library.git diff --git a/lib/HTML/Element/Library.pm b/lib/HTML/Element/Library.pm index 024e114..cb9cec3 100644 --- a/lib/HTML/Element/Library.pm +++ b/lib/HTML/Element/Library.pm @@ -98,6 +98,26 @@ sub HTML::Element::prune { $self; } +sub HTML::Element::newnode { + my ($lol, $node_label, $new_node)=@_; + + use Data::Rmap qw(rmap_array); + + my ($mapresult) = rmap_array { + + + if ($_->[0] eq $node_label) { + $_ = $new_node; + Data::Rmap::cut($_); + } else { + $_; + } + + } $lol; + + $mapresult; + +} sub HTML::Element::crunch { my $container = shift;