%# "I have the simplest tastes.  I am always satisfied with the best."
%# 		-- Oscar Wilde
<%PERL>
my $Section = $Part->parent;
return if $Section->tag ne 'content' and $Type !~ /^(?:p|img)$/;

my $NewPart = XML::Twig::Elt->new($Type);

# replace the part if it's an empty 'P'
if ($Part->type eq 'p' and !length($Part->text)) {
    $NewPart->replace($Part);
}
else {
    $NewPart->paste(after => $Part);
    $modifier = 1; # move next
}
</$PERL>
<%ARGS>
$Part
$Type
</%ARGS>
