Skip to content

Commit

Permalink
another Mojo::DOM example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 3, 2015
1 parent ac3ef4f commit f43208c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

6.13 2015-07-02
6.13 2015-07-03
- Improved subscribers method in Mojo::EventEmitter to allow subscribers to be
modified more easily.

Expand Down
5 changes: 5 additions & 0 deletions lib/Mojo/DOM.pm
Expand Up @@ -573,6 +573,11 @@ element as L<Mojo::DOM> objects.
->descendant_nodes->grep(sub { $_->type eq 'comment' })
->map('remove')->first;
# "<p><b>test</b>test</p>"
$dom->parse('<p><b>123</b>456</p>')
->at('p')->descendant_nodes->grep(sub { $_->type eq 'text' })
->map(content => 'test')->first->root;
=head2 find
my $collection = $dom->find('div ~ p');
Expand Down

0 comments on commit f43208c

Please sign in to comment.