Skip to content

Commit

Permalink
these two methods work on all node types
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 9, 2014
1 parent f308b6d commit b8cd5da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojo/DOM.pm
Expand Up @@ -94,8 +94,8 @@ sub contents { $_[0]->_collect(_nodes($_[0]->tree)) }

sub find { $_[0]->_collect(@{$_[0]->_css->select($_[1])}) }

sub following_siblings { $_[0]->_collect(@{_siblings($_[0])->[1]}) }
sub following { _select($_[0]->_collect(@{_siblings($_[0], 1)->[1]}), $_[1]) }
sub following_siblings { $_[0]->_collect(@{_siblings($_[0])->[1]}) }

sub match { $_[0]->_css->match($_[1]) ? $_[0] : undef }

Expand Down Expand Up @@ -663,7 +663,7 @@ objects. All selectors from L<Mojo::DOM::CSS/"SELECTORS"> are supported.
my $collection = $dom->following_siblings;
Return a L<Mojo::Collection> object containing the sibling nodes after this
element as L<Mojo::DOM> objects.
node as L<Mojo::DOM> objects.
# " C "
$dom->parse('<p>A</p>B<!-- C -->')
Expand Down Expand Up @@ -762,7 +762,7 @@ objects. All selectors from L<Mojo::DOM::CSS/"SELECTORS"> are supported.
my $collection = $dom->preceding_siblings;
Return a L<Mojo::Collection> object containing the sibling nodes before this
element as L<Mojo::DOM> objects.
node as L<Mojo::DOM> objects.
# "B"
$dom->parse('<!-- A -->B<p>C</p>D')
Expand Down

0 comments on commit b8cd5da

Please sign in to comment.