Feed fixes
[catagits/XML-Feed.git] / lib / XML / Feed / Atom.pm
index 973a287..5704b3b 100644 (file)
@@ -128,12 +128,22 @@ sub summary {
     }
 }
 
+my %types = (
+       'text/xhtml' => 'xhtml',
+       'text/html'  => 'html',
+       'text/plain' => 'text',
+);
+
 sub content {
     my $entry = shift;
     if (@_) {
         my %param;
         if (ref($_[0]) eq 'XML::Feed::Content') {
-            %param = (Body => $_[0]->body, Type => ($_[0]->type eq 'text/html')? 'html' : 'text');
+                       if (defined $_[0]->type && defined $types{$_[0]->type}) {
+                   %param = (Body => $_[0]->body, Type => $types{$_[0]->type});
+                       } else {
+                   %param = (Body => $_[0]->body);
+                       }
         } else {
             %param = (Body => $_[0]);
         }