Build.PL
Changes
-lib/XML/Feed.pm
lib/XML/Feed/Content.pm
lib/XML/Feed/Enclosure.pm
lib/XML/Feed/Entry.pm
lib/XML/Feed/Format/Atom.pm
lib/XML/Feed/Format/RSS.pm
-MANIFEST This list of files
+lib/XML/Feed.pm
MANIFEST.SKIP
+MANIFEST This list of files
META.yml
README
t/00-compile.t
t/11-xml-base-atom.t
t/11-xml-base-rss.t
t/12-multi-categories-atom.t
-t/12-multi-categories-rss.t
t/12-multi-categories.base
+t/12-multi-categories-rss.t
t/12-multi-subjects-rss.t
t/13-category-hash-bug.t
t/14-enclosures.t
t/14-multi-enclosures.t
t/15-odd-date.t
+t/16-convert.t
t/pod-coverage.t
t/pod.t
t/samples/atom-10-example.xml
t/samples/base_atom.xml
t/samples/base_rss.xml
t/samples/category-bug.xml
-t/samples/rss-multiple-categories.xml
-t/samples/rss-multiple-subjects.xml
+t/samples/rss10-davorg-journal.xml
t/samples/rss10-invalid-date.xml
t/samples/rss10-odd-date.xml
t/samples/rss10.xml
t/samples/rss20-multi-enclosure.xml
t/samples/rss20-no-summary.xml
t/samples/rss20.xml
+t/samples/rss-multiple-categories.xml
+t/samples/rss-multiple-subjects.xml
use XML::Atom::Util qw( iso2dt );
use List::Util qw( first );
use DateTime::Format::W3CDTF;
+use HTML::Entities;
use XML::Atom::Entry;
XML::Atom::Entry->mk_elem_accessors(qw( lat long ), ['http://www.w3.org/2003/01/geo/wgs84_pos#']);
if (@_) {
my %param;
my $base;
+ my $orig_body;
if (ref($_[0]) eq 'XML::Feed::Content') {
+ $orig_body = $_[0]->body;
if (defined $_[0]->type && defined $types{$_[0]->type}) {
%param = (Body => $_[0]->body, Type => $types{$_[0]->type});
+
+ if ($param{'Type'} eq "html") {
+ $param{'Body'} = HTML::Entities::encode_entities($param{'Body'});
+ }
} else {
- %param = (Body => $_[0]->body);
+ %param = (Body => $_[0]->body);
}
$base = $_[0]->base if defined $_[0]->base;
} else {
+ $orig_body = $_[0];
%param = (Body => $_[0]);
}
+ #if (!exists($param{Body}))
+ #{
+ # $param{Body} = $orig_body;
+ #}
$entry->{entry}->content(XML::Atom::Content->new(%param, Version => 1.0));
+ # Assigning again so the type will be normalized. This seems to be
+ # an XML-Atom do-what-I-don't-meannery.
+ #$entry->{entry}->content->body($orig_body);
$entry->{entry}->content->base($base) if defined $base;
} else {
my $c = $entry->{entry}->content;