Skip to content

Commit

Permalink
set the default at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 29, 2016
1 parent 158cd21 commit 0fcdf7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -199,11 +199,10 @@ sub _all {
}

sub _all_text {
my ($self, $recurse, $trim) = @_;
my ($self, $recurse, $trim) = (shift, shift, shift // 1);

# Detect "pre" tag
my $tree = $self->tree;
$trim = 1 unless defined $trim;
map { $_->[1] eq 'pre' and $trim = 0 } $self->_ancestors, $tree
if $trim && $tree->[0] ne 'root';

Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -57,8 +57,8 @@ sub _form_for {
}

sub _hidden_field {
my $c = shift;
return _tag('input', name => shift, value => shift, @_, type => 'hidden');
my ($c, $name, $value) = (shift, shift, shift);
return _tag('input', name => $name, value => $value, @_, type => 'hidden');
}

sub _input {
Expand Down Expand Up @@ -156,8 +156,8 @@ sub _stylesheet {
}

sub _submit_button {
my $c = shift;
return _tag('input', value => shift // 'Ok', @_, type => 'submit');
my ($c, $value) = (shift, shift // 'Ok');
return _tag('input', value => $value, @_, type => 'submit');
}

sub _tag {
Expand Down

0 comments on commit 0fcdf7f

Please sign in to comment.