Skip to content

Commit

Permalink
parsing should not be required
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 7, 2015
1 parent 041990e commit 2fcd0e0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

5.78 2015-02-08
- Improved design of built-in templates.
- Fixed bug in Mojo::DOM that made parsing a requirement.
- Fixed warnings in Mojo::URL.

5.77 2015-02-03
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/DOM/HTML.pm
Expand Up @@ -4,7 +4,8 @@ use Mojo::Base -base;
use Mojo::Util qw(html_unescape xml_escape);
use Scalar::Util 'weaken';

has [qw(tree xml)];
has tree => sub { ['root'] };
has 'xml';

my $ATTR_RE = qr/
([^<>=\s\/]+|\/) # Key
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -112,7 +112,7 @@ sub _read {
sub _write {
my $self = shift;

# Handle errors when reading, to avoid timing problems
# Handle errors only when reading (to avoid timing problems)
my $handle = $self->{handle};
if (length $self->{buffer}) {
return unless defined(my $written = $handle->syswrite($self->{buffer}));
Expand Down
9 changes: 6 additions & 3 deletions t/mojo/dom.t
Expand Up @@ -4,9 +4,12 @@ use Test::More;
use Mojo::DOM;

# Empty
is(Mojo::DOM->new, '', 'right result');
is(Mojo::DOM->new(''), '', 'right result');
is(Mojo::DOM->new->parse(''), '', 'right result');
is(Mojo::DOM->new, '', 'right result');
is(Mojo::DOM->new(''), '', 'right result');
is(Mojo::DOM->new->parse(''), '', 'right result');
is(Mojo::DOM->new->at('p'), undef, 'no result');
is(Mojo::DOM->new->append_content(''), '', 'right result');
is(Mojo::DOM->new->append_content('0'), '0', 'right result');

# Simple (basics)
my $dom = Mojo::DOM->new(
Expand Down

0 comments on commit 2fcd0e0

Please sign in to comment.