Skip to content

Commit

Permalink
update version & fix pod (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azq2 committed Dec 12, 2020
1 parent eac36eb commit 7cb036f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/HTML5/DOM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use HTML5::DOM::Collection;
use HTML5::DOM::CSS;
use HTML5::DOM::TokenList;

our $VERSION = '1.16';
our $VERSION = '1.17';
require XSLoader;

# https://developer.mozilla.org/pl/docs/Web/API/Element/nodeType
Expand Down
20 changes: 16 additions & 4 deletions lib/HTML5/DOM.pod
Original file line number Diff line number Diff line change
Expand Up @@ -1061,9 +1061,9 @@ HTML serialization of the node's descendants.
Example:

my $tree = HTML5::DOM->new->parse('<div id="test">some <b>bold</b> test</div>');
print $tree->outerHTML; # <div id="test">some <b>bold</b> test</div>
print $tree->getElementById('test')->outerHTML; # <div id="test">some <b>bold</b> test</div>
print $tree->createComment(' test ')->outerHTML; # <!-- test -->
print $tree->createTextNode('test')->outerHTML; # test
print $tree->createTextNode('test')->outerHTML; # test

=item *

Expand All @@ -1075,9 +1075,9 @@ HTML serialization of the node and its descendants.
Example:

my $tree = HTML5::DOM->new->parse('<div id="test">some <b>bold</b> test</div>');
print $tree->innerHTML; # some <b>bold</b> test
print $tree->getElementById('test')->innerHTML; # some <b>bold</b> test
print $tree->createComment(' test ')->innerHTML; # <!-- test -->
print $tree->createTextNode('test')->innerHTML; # test
print $tree->createTextNode('test')->innerHTML; # test

=item *

Expand All @@ -1095,6 +1095,18 @@ Example:

=item *

HTML serialization of entire document

my $html = $tree->document->html;
my $html = $node->document->outerHTML;

Example:

my $tree = HTML5::DOM->new->parse('<!DOCTYPE html><div id="test">some <b>bold</b> test</div>');
print $tree->document->outerHTML; # <!DOCTYPE html><html><head></head><body><div id="test">some <b>bold</b> test</div></body></html>

=item *

Replaces the element and all of its descendants with a new DOM tree constructed by parsing the specified B<$new_html>.

# parse fragment and node in parent node childs with it
Expand Down

0 comments on commit 7cb036f

Please sign in to comment.