my ($data, $text) = ($1, $2);
if ($data =~ /^for layout (\S+)/) {
my $fname = $1;
- #remove extra whitespace without killing indentation
- #remove all empty leading lines. and trailing whitespace
- ($layouts->{$fname}) =
- ($text =~ /^(?:\s*\n)*((?:.*?\n)*(?:.*?\S+.*?\n))\s*$/m);
+ $text =~ s/^(?:\s*\r?\n)+//; #remove leading empty lines
+ $text =~ s/[\s\r\n]+$//; #remove trailing whitespace
+ $layouts->{$fname} = $text;
} elsif ($data =~ /^extends (\S+)/) {
my $super_name = $1;
$self->super($build_args->{view}->create_layout_set($super_name))
};
implements fragment cancel_button_fragment {
- if (grep { $_ eq 'cancel' } $_{viewport}->accept_events) {
- arg 'event_id' => event_id 'cancel';
- arg 'label' => $_{viewport}->cancel_label;
+ if (grep { $_ eq 'close' } $_{viewport}->accept_events) {
+ arg 'event_id' => event_id 'close';
+ arg 'label' => $_{viewport}->close_label;
render 'cancel_button';
}
};