From: Matt S Trout Date: Thu, 1 Jul 2010 06:21:16 +0000 (+0100) Subject: shallow copy event hashes for is_in_place_close handling in replace X-Git-Tag: release_0.009004~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=ec6871014adf8d90f1e6afab7e0902d44cf8b264 shallow copy event hashes for is_in_place_close handling in replace --- diff --git a/lib/HTML/Zoom/FilterBuilder.pm b/lib/HTML/Zoom/FilterBuilder.pm index 32ffe11..6e4a37c 100644 --- a/lib/HTML/Zoom/FilterBuilder.pm +++ b/lib/HTML/Zoom/FilterBuilder.pm @@ -197,11 +197,11 @@ sub replace { # then we need to handle that here if ($options->{content} && ref($coll) eq 'HASH' - && delete $coll->{is_in_place_close} + && $coll->{is_in_place_close} ) { - delete $coll->{raw}; my $close = $stream->next; - delete @{$close}{qw(is_in_place_close raw)}; + # shallow copy and nuke in place and raw (to force smart print) + $_ = { %$_ }, delete @{$_}{qw(is_in_place_close raw)} for ($coll, $close); $emit = $self->_stream_concat( $emit, $self->_stream_from_array($close),