add a default 404 and 403 action, use the 404 on collection controller, make html...
[catagits/Reaction.git] / lib / Reaction / UI / LayoutSet.pm
index da4ecdc..792bb70 100644 (file)
@@ -80,7 +80,10 @@ class LayoutSet which {
       my ($data, $text) = ($1, $2);
       if ($data =~ /^for layout (\S+)/) {
         my $fname = $1;
-        $layouts->{$fname} = $text;
+        #remove extra whitespace without killing indentation
+        #remove all empty leading lines. and trailing whitespace
+        ($layouts->{$fname}) =
+          ($text =~ /^(?:\s*\n)*((?:.*?\n)*(?:.*?\S+.*?\n))\s*$/m);
       } elsif ($data =~ /^extends (\S+)/) {
         my $super_name = $1;
         $self->super($build_args->{view}->create_layout_set($super_name))