Skip to content

Commit

Permalink
Use HTML::Entities instead of CGI (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Oct 28, 2015
1 parent 2246113 commit c51714c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions cpanfile
Expand Up @@ -2,3 +2,4 @@ requires 'perl', '>= 5.10.0';
requires 'RDF::NS','>= 20131002';
requires 'RDF::Trine','1.000';
requires 'Try::Tiny','0';
requires 'HTML::Entities', '3.63';
4 changes: 2 additions & 2 deletions lib/RDF/Lazy.pm
Expand Up @@ -7,7 +7,7 @@ our $VERSION = '0.09';

use RDF::Trine::Model;
use RDF::NS qw(20120827);
use CGI qw(escapeHTML);
use HTML::Entities qw(encode_entities);

use RDF::Trine::Serializer::RDFXML;
use RDF::Trine::Serializer::Turtle;
Expand Down Expand Up @@ -212,7 +212,7 @@ sub rdfxml {

sub ttlpre {
return '<pre class="turtle">'
. escapeHTML( "# " . ($_[0]->str||'') . "\n" . turtle(@_) )
. encode_entities( "# " . ($_[0]->str||'') . "\n" . turtle(@_) )
. '</pre>';
}

Expand Down
1 change: 0 additions & 1 deletion lib/RDF/Lazy/Literal.pm
Expand Up @@ -5,7 +5,6 @@ use v5.10;

use base 'RDF::Lazy::Node';
use Scalar::Util qw(blessed);
use CGI qw(escapeHTML);

use overload '""' => sub { shift->str; };

Expand Down
4 changes: 2 additions & 2 deletions lib/RDF/Lazy/Node.pm
Expand Up @@ -6,15 +6,15 @@ use RDF::Lazy::Literal;
use RDF::Lazy::Resource;
use RDF::Lazy::Blank;
use RDF::Trine qw(iri);
use CGI qw(escapeHTML);
use HTML::Entities qw(encode_entities);
use Carp qw(carp);

our $AUTOLOAD;
our $rdf_type = iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type');

sub trine { shift->[0]; }
sub graph { shift->[1]; }
sub esc { escapeHTML( shift->str ) }
sub esc { encode_entities( shift->str ) }

sub is_literal { shift->[0]->is_literal; }
sub is_resource { shift->[0]->is_resource; }
Expand Down
1 change: 0 additions & 1 deletion lib/RDF/Lazy/Resource.pm
Expand Up @@ -4,7 +4,6 @@ use warnings;

use base 'RDF::Lazy::Node';
use Scalar::Util qw(blessed);
use CGI qw(escapeHTML);
use Try::Tiny;

use overload '""' => \&str;
Expand Down

0 comments on commit c51714c

Please sign in to comment.