X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FLayoutSet.pm;h=792bb701036de91e695d631a1c1b1d1f248177c8;hb=cb92a3a388a813d1309757155a4b7750eb9f5504;hp=4a9c533bee043bb4fb4192cd784fa3eb08b1db97;hpb=aa8c0c904641fa20c5f50882d09c1502aae19b3a;p=catagits%2FReaction.git diff --git a/lib/Reaction/UI/LayoutSet.pm b/lib/Reaction/UI/LayoutSet.pm index 4a9c533..792bb70 100644 --- a/lib/Reaction/UI/LayoutSet.pm +++ b/lib/Reaction/UI/LayoutSet.pm @@ -78,10 +78,12 @@ class LayoutSet which { # doesn't have the match pos go past the latter = and lose name2 while ($data =~ m/=(.*?)\n(.*?)(?:\n(?==)|$)/sg) { 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))