Skip to content

Commit

Permalink
updated Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 23, 2012
1 parent 22ae144 commit 683e11f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -6,6 +6,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved tests.
- Fixed small parser bug in Mojo::Message::Response.
- Fixed small partial rendering bug.
- Fixed small HTML5 parser bug in Mojo::DOM::HTML. (dougwilson)

2.45 2012-01-18 00:00:00
- Removed T-Shirt link.
Expand Down
16 changes: 8 additions & 8 deletions lib/Mojo/DOM.pm
Expand Up @@ -471,11 +471,11 @@ Extract all text content from DOM structure, smart whitespace trimming is
activated by default. Note that the trim argument of this method is
EXPERIMENTAL and might change without warning!
# "test 123"
$dom->parse("<div>test\n<p>123</p></div>")->div->all_text;
# "foo bar baz"
$dom->parse("<div>foo\n<p>bar</p>baz\n</div>")->div->all_text;
# "test\n123"
$dom->parse("<div>test\n<p>123</p></div>")->div->all_text(0);
# "foo\nbarbaz\n"
$dom->parse("<div>foo\n<p>bar</p>baz\n</div>")->div->all_text(0);
=head2 C<append>
Expand Down Expand Up @@ -614,11 +614,11 @@ Extract text content from element only (not including child elements), smart
whitespace trimming is activated by default. Note that the trim argument of
this method is EXPERIMENTAL and might change without warning!
# "test"
$dom->parse("<div>test\n<p>123</p></div>")->div->text;
# "foo baz"
$dom->parse("<div>foo\n<p>bar</p>baz\n</div>")->div->text;
# "test\n"
$dom->parse("<div>test\n<p>123</p></div>")->div->text(0);
# "foo\nbaz\n"
$dom->parse("<div>foo\n<p>bar</p>baz\n</div>")->div->text(0);
=head2 C<to_xml>
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious.pm
Expand Up @@ -794,6 +794,8 @@ Dmitriy Shalashov
Dmitry Konstantinov
Douglas Christopher Wilson
Eugene Toropov
Gisle Aas
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/dom.t
Expand Up @@ -1988,11 +1988,11 @@ is $dom->tree->[0], 'root', 'right element';
is $dom->tree->[1]->[0], 'tag', 'right element';
is $dom->tree->[1]->[1], 'foo', 'right tag';
is_deeply $dom->tree->[1]->[2], {bar => ''}, 'right attributes';
is $dom->tree->[1]->[4]->[0], 'text', 'right element';
is $dom->tree->[1]->[4]->[0], 'text', 'right element';
is $dom->tree->[1]->[4]->[1], "\n test\n", 'right text';
is $dom->tree->[3]->[0], 'tag', 'right element';
is $dom->tree->[3]->[1], 'bar', 'right tag';
is $dom->tree->[3]->[4]->[0], 'text', 'right element';
is $dom->tree->[3]->[4]->[0], 'text', 'right element';
is $dom->tree->[3]->[4]->[1], 'after', 'right text';
is "$dom", <<EOF, 'stringified right';
<foo bar="">
Expand Down

0 comments on commit 683e11f

Please sign in to comment.