Skip to content

Commit

Permalink
there is actually no need to trim anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 31, 2015
1 parent a6cef6b commit d1b5553
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/entities.pl
@@ -1,14 +1,13 @@
use Mojo::Base -strict;
use Mojo::UserAgent;
use Mojo::Util 'trim';

# Extract named character references from HTML Living Standard
my $tx = Mojo::UserAgent->new->get('https://html.spec.whatwg.org');
my $rows = $tx->res->dom('#named-character-references-table tbody > tr');
for my $row ($rows->each) {
my $entity = $row->at('td > code')->text;
my $codepoints = $row->children('td')->[1]->text;
say trim "$entity $codepoints";
say "$entity $codepoints";
}

1;

1 comment on commit d1b5553

@kberov
Copy link
Contributor

@kberov kberov commented on d1b5553 Apr 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This data is also available as JSON file
https://html.spec.whatwg.org/entities.json

Please sign in to comment.