Skip to content

Commit

Permalink
fixed whitespace bug in Mojo::DOM::CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 10, 2015
1 parent 00805dc commit 2ced6e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -4,6 +4,7 @@
[foo="bar" i] to Mojo::DOM::CSS.
- Improved Mojo::Reactor::EV to update the current time before starting a
timer.
- Fixed whitespace bug in Mojo::DOM::CSS.

5.71 2015-01-01
- Updated Net::DNS::Native requirement to 0.15 for some important bug fixes.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -125,10 +125,10 @@ sub _equation {
return [] unless my $equation = shift;

# "even"
return [2, 2] if $equation =~ /^even$/i;
return [2, 2] if $equation =~ /^\s*even\s*$/i;

# "odd"
return [2, 1] if $equation =~ /^odd$/i;
return [2, 1] if $equation =~ /^\s*odd\s*$/i;

# Equation
my $num = [1, 1];
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/dom.t
Expand Up @@ -939,7 +939,7 @@ is_deeply \@li, [qw(B D F H)], 'found all even li elements';
$dom->find('li:NTH-CHILD(EVEN)')->each(sub { push @li, shift->text });
is_deeply \@li, [qw(B D F H)], 'found all even li elements';
@li = ();
$dom->find('li:nth-last-child(even)')->each(sub { push @li, shift->text });
$dom->find('li:nth-last-child( even )')->each(sub { push @li, shift->text });
is_deeply \@li, [qw(A C E G)], 'found all even li elements';
@li = ();
$dom->find('li:nth-child(2n+2)')->each(sub { push @li, shift->text });
Expand Down Expand Up @@ -1061,7 +1061,7 @@ is_deeply \@e, [qw(A C E G I)], 'found all odd elements';
$dom->find('li:nth-of-type(odd)')->each(sub { push @e, shift->text });
is_deeply \@e, [qw(A E H)], 'found all odd li elements';
@e = ();
$dom->find('li:nth-last-of-type(odd)')->each(sub { push @e, shift->text });
$dom->find('li:nth-last-of-type( odd )')->each(sub { push @e, shift->text });
is_deeply \@e, [qw(C F I)], 'found all odd li elements';
@e = ();
$dom->find('p:nth-of-type(odd)')->each(sub { push @e, shift->text });
Expand Down

0 comments on commit 2ced6e6

Please sign in to comment.