Skip to content

Commit

Permalink
more Mojo::DOM examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 1, 2012
1 parent 9798081 commit d92e0a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

2.99 2012-06-01
2.99 2012-06-02
- Improved documentation.
- Fixed small JSON Pointer bug in get command. (avkhozov)

Expand Down
6 changes: 6 additions & 0 deletions lib/Mojo/DOM.pm
Expand Up @@ -637,6 +637,9 @@ Replace elements.
# "<div><h2>B</h2></div>"
$dom->parse('<div><h1>A</h1></div>')->at('h1')->replace('<h2>B</h2>');
# "<div></div>"
$dom->parse('<div><h1>A</h1></div>')->at('h1')->replace('');
=head2 C<replace_content>
$dom = $dom->replace_content('test');
Expand All @@ -646,6 +649,9 @@ Replace element content.
# "<div><h1>B</h1></div>"
$dom->parse('<div><h1>A</h1></div>')->at('h1')->replace_content('B');
# "<div><h1></h1></div>"
$dom->parse('<div><h1>A</h1></div>')->at('h1')->replace_content('');
=head2 C<root>
my $root = $dom->root;
Expand Down

0 comments on commit d92e0a2

Please sign in to comment.