-
Notifications
You must be signed in to change notification settings - Fork 588
Add an inline_layout stash keyword, based on the mojo.js inlineLayout one. #1887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,14 @@ sub render { | |
|
|
||
| # Inheritance | ||
| my $content = $stash->{'mojo.content'} //= {}; | ||
| local $content->{content} = $output =~ /\S/ ? $output : undef if $stash->{extends} || $stash->{layout}; | ||
| local $content->{content} = $output =~ /\S/ ? $output : undef | ||
| if $stash->{extends} || $stash->{layout} || $stash->{inline_layout}; | ||
| if (defined $stash->{inline_layout}) { | ||
| local $options->{inline} = delete $stash->{inline_layout}; | ||
| delete $stash->{layout}; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do the tests still pass if this line is removed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They do. I tried to write something to test this line but did not succeed (setting Do you have an idea of how to test it? Or do you think that it should be removed?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code that does nothing should not be present. |
||
| if ($self->_render_template($c, \my $tmp, $options)) { $output = $tmp } | ||
| $content->{content} //= $output if $output =~ /\S/; | ||
mkende marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| while ((my $next = _next($stash)) && !defined $inline) { | ||
| @$options{qw(handler template)} = ($stash->{handler}, $next); | ||
| $options->{format} = $stash->{format} || $self->default_format; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.