Skip to content

Commit

Permalink
more detailed description for wrap method
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 4, 2014
1 parent 401f11c commit 4b6264c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -204,7 +204,7 @@ sub wrap {

return $self if (my $tree = $self->tree)->[0] eq 'root';

# Find inmost tag
# Find innermost tag
my $current;
my $first = $new = $self->_parse("$new");
$current = $first while $first = first { $_->[0] eq 'tag' } _nodes($first);
Expand Down Expand Up @@ -814,7 +814,8 @@ This element's type.
$dom = $dom->wrap('<p></p>');
Wrap HTML/XML fragment around this element.
Wrap HTML/XML fragment around this element using the first innermost element,
which may contain text content.
# "<div>B<h1>A</h1></div>"
$dom->parse('<h1>A</h1>')->at('h1')->wrap('<div>B</div>')->root;
Expand Down

0 comments on commit 4b6264c

Please sign in to comment.