Skip to content

Commit

Permalink
consistently check for non-whitespace characters
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 28, 2016
1 parent c64d4cc commit 24e76c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -126,13 +126,13 @@ sub render {

# Inheritance
my $content = $stash->{'mojo.content'} ||= {};
local $content->{content} = $output if $stash->{extends} || $stash->{layout};
local $content->{content} = $output =~ /\S/ ? $output : undef
if $stash->{extends} || $stash->{layout};
while ((my $next = _next($stash)) && !defined $inline) {
@$options{qw(handler template)} = ($stash->{handler}, $next);
$options->{format} = $stash->{format} || $self->default_format;
if ($self->_render_template($c, \my $tmp, $options)) { $output = $tmp }
$content->{content} = $output
if $content->{content} !~ /\S/ && $output =~ /\S/;
$content->{content} //= $output if $output =~ /\S/;
}

# Encoding
Expand Down

0 comments on commit 24e76c0

Please sign in to comment.