[Slashdotjp-dev 645] CVS update: slashjp/Slash/XML/RSS

Zurück zum Archiv-Index

Tatsuki SUGIURA sugi****@users*****
2006年 11月 20日 (月) 19:32:08 JST


Index: slashjp/Slash/XML/RSS/RSS.pm
diff -u slashjp/Slash/XML/RSS/RSS.pm:1.4 slashjp/Slash/XML/RSS/RSS.pm:1.5
--- slashjp/Slash/XML/RSS/RSS.pm:1.4	Wed Jul 12 20:41:42 2006
+++ slashjp/Slash/XML/RSS/RSS.pm	Mon Nov 20 19:32:08 2006
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: RSS.pm,v 1.4 2006/07/12 11:41:42 sugi Exp $
+# $Id: RSS.pm,v 1.5 2006/11/20 10:32:08 sugi Exp $
 
 package Slash::XML::RSS;
 
@@ -32,7 +32,7 @@
 use base 'Slash::XML';
 use vars qw($VERSION);
 
-($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 
 #========================================================================
@@ -219,6 +219,10 @@
 			prefix  => 'slash',
 			uri     => 'http://purl.org/rss/1.0/modules/slash/',
 		) if $item->{story};
+		$rss->add_module(
+			prefix => 'content',
+			uri    => 'http://purl.org/rss/1.0/modules/content/',
+		);
 
 	} elsif ($version >= 0.91) {
 		# fix mappings for 0.91
@@ -320,6 +324,14 @@
 						my $desc = $self->rss_item_description($item->{$key});
 						$encoded_item->{$key} = $desc if $desc;
 					}
+				} elsif ($key eq 'content:encoded' && $self->{rdfitem_content}) {
+					if ($version == 1) {
+						my $rdfitemdesc_html_bak = $self->{rdfitemdesc_html};
+						$self->{rdfitemdesc_html} = 1;
+						my $encoded = $self->rss_item_description($item->{$key});
+						$encoded_item->{content}->{encoded} = "<![CDATA[" . $self->encode($encoded) . "]]>";
+						$self->{rdfitemdesc_html} = $rdfitemdesc_html_bak;
+					}
 				} else {
 					my $data = $item->{$key};
 					if ($key eq 'link') {
@@ -562,4 +574,4 @@
 
 =head1 VERSION
 
-$Id: RSS.pm,v 1.4 2006/07/12 11:41:42 sugi Exp $
+$Id: RSS.pm,v 1.5 2006/11/20 10:32:08 sugi Exp $


Slashdotjp-dev メーリングリストの案内
Zurück zum Archiv-Index