[Bast-commits] r6451 - in ironman/plagger/lib:
Plagger/Plugin/Publish XML/Atom
szbalint at dev.catalyst.perl.org
szbalint at dev.catalyst.perl.org
Thu May 28 19:07:12 GMT 2009
Author: szbalint
Date: 2009-05-28 19:07:12 +0000 (Thu, 28 May 2009)
New Revision: 6451
Modified:
ironman/plagger/lib/Plagger/Plugin/Publish/Feed.pm
ironman/plagger/lib/XML/Atom/Content.pm
Log:
Forcing the Atom feed to present the text based summary as content type="text".
Modified: ironman/plagger/lib/Plagger/Plugin/Publish/Feed.pm
===================================================================
--- ironman/plagger/lib/Plagger/Plugin/Publish/Feed.pm 2009-05-28 16:06:31 UTC (rev 6450)
+++ ironman/plagger/lib/Plagger/Plugin/Publish/Feed.pm 2009-05-28 19:07:12 UTC (rev 6451)
@@ -66,7 +66,13 @@
my $entry = XML::Feed::Entry->new($feed_format);
$entry->title($e->title);
$entry->link($e->permalink);
- $entry->summary($e->body_text) if defined $e->body;
+ if (defined $e->body) {
+ if ($feed_format eq 'RSS') {
+ $entry->summary($e->body_text);
+ } else {
+ $entry->{entry}->summary(XML::Atom::Content->new(Body => $e->body_text, Version => 1.0, AssumeType => 'text'));
+ }
+ }
# hack to bypass XML::Feed Atom 0.3 crufts (type="text/html")
if ($self->conf->{full_content} && defined $e->body) {
Modified: ironman/plagger/lib/XML/Atom/Content.pm
===================================================================
--- ironman/plagger/lib/XML/Atom/Content.pm 2009-05-28 16:06:31 UTC (rev 6450)
+++ ironman/plagger/lib/XML/Atom/Content.pm 2009-05-28 19:07:12 UTC (rev 6451)
@@ -64,7 +64,7 @@
if $xp;
}
};
- if (!$@ && $node) {
+ if (!$@ && $node && (!$assume_type || $assume_type ne 'text')) {
$elem->appendChild($node);
if ($content->version == 0.3) {
$content->mode('xml');
More information about the Bast-commits
mailing list