[Slashdotjp-dev 460] CVS update: slashjp/plugins/Print

アーカイブの一覧に戻る

Tatsuki SUGIURA sugi****@users*****
2006年 7月 12日 (水) 20:41:53 JST


Index: slashjp/plugins/Print/INSTALL
diff -u slashjp/plugins/Print/INSTALL:1.3 slashjp/plugins/Print/INSTALL:1.4
--- slashjp/plugins/Print/INSTALL:1.3	Fri Dec 31 21:37:13 2004
+++ slashjp/plugins/Print/INSTALL	Wed Jul 12 20:41:53 2006
@@ -1,5 +1,5 @@
 #
-# $Id: INSTALL,v 1.3 2004/12/31 12:37:13 oliver Exp $
+# $Id: INSTALL,v 1.4 2006/07/12 11:41:53 sugi Exp $
 #
 
 Don't forget to modify the display;article;default template to add a link to
Index: slashjp/plugins/Print/PLUGIN
diff -u slashjp/plugins/Print/PLUGIN:1.2 slashjp/plugins/Print/PLUGIN:1.3
--- slashjp/plugins/Print/PLUGIN:1.2	Fri Dec 24 05:13:42 2004
+++ slashjp/plugins/Print/PLUGIN	Wed Jul 12 20:41:53 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.2 2004/12/23 20:13:42 oliver Exp $
+# $Id: PLUGIN,v 1.3 2006/07/12 11:41:53 sugi Exp $
 name=Print
 htdoc=print.pl
 image=images/print.gif
Index: slashjp/plugins/Print/print.pl
diff -u slashjp/plugins/Print/print.pl:1.3 slashjp/plugins/Print/print.pl:1.4
--- slashjp/plugins/Print/print.pl:1.3	Fri Dec 31 21:37:13 2004
+++ slashjp/plugins/Print/print.pl	Wed Jul 12 20:41:53 2006
@@ -28,9 +28,9 @@
 # 	ISBN: 0-596-00200-2
 
 # This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: print.pl,v 1.3 2004/12/31 12:37:13 oliver Exp $
+# $Id: print.pl,v 1.4 2006/07/12 11:41:53 sugi Exp $
 
 use strict;
 use HTML::TreeBuilder;
@@ -39,7 +39,7 @@
 use Slash::Utility;
 use vars qw( $VERSION );
 
-($VERSION) = ' $Revision: 1.3 $' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $' =~ /\$Revision:\s+([^\s]+)/;
 
 sub main {
 	my $constants = getCurrentStatic();
@@ -99,7 +99,9 @@
 	# routine in admin.pl to use it instead -- pudge
 	my @story_links;
 	my $tree = new HTML::TreeBuilder;
-	$tree->parse(parseSlashizedLinks($story->{introtext} . $story->{bodytext}));
+	my $storytext = $story->{introtext} || '';
+	$storytext .= $story->{bodytext} if defined $story->{bodytext};
+	$tree->parse(processSlashTags(parseSlashizedLinks($storytext)));
 	$tree->eof;
 	my $links = $tree->extract_links('a');  # get "A" tags only
 
@@ -153,9 +155,12 @@
 # Thanks for the assist here, pudge!
 sub get_content {
 	my($ref) = @_;
-	my $content;
+	return '' if !$ref || !ref($ref->{_content});
 
-	$content .= (ref) ? get_content($_) : $_ for @{$ref->{_content}};
+	my $content = '';
+	for my $c (@{$ref->{_content}}) {
+		$content .= ref($c) ? get_content($c) : $c;
+	}
 	
 	return $content;
 }


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る