[Slashdotjp-dev 608] CVS update: slashjp/Slash/Utility/Data

Back to archive index

Tatsuki SUGIURA sugi****@users*****
2006年 9月 6日 (水) 19:16:48 JST


Index: slashjp/Slash/Utility/Data/Data.pm
diff -u slashjp/Slash/Utility/Data/Data.pm:1.19 slashjp/Slash/Utility/Data/Data.pm:1.20
--- slashjp/Slash/Utility/Data/Data.pm:1.19	Sat Sep  2 00:53:38 2006
+++ slashjp/Slash/Utility/Data/Data.pm	Wed Sep  6 19:16:48 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: Data.pm,v 1.19 2006/09/01 15:53:38 sugi Exp $
+# $Id: Data.pm,v 1.20 2006/09/06 10:16:48 sugi Exp $
 
 package Slash::Utility::Data;
 
@@ -62,7 +62,7 @@
 	$HTML::Tagset::linkElements{slash} = ['src', 'href'];
 }
 
-($VERSION) = ' $Revision: 1.19 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.20 $ ' =~ /\$Revision:\s+([^\s]+)/;
 @EXPORT	   = qw(
 	addDomainTags
 	createStoryTopicData
@@ -2968,6 +2968,9 @@
 
 	$html =~ s{<a([^>]*) title="([^"]+")>} {<a$1>}gi if $notitle;
 	
+	# truncate long URL
+	$html =~ s|(<a[^>]+>\s*)(\w+://[^<]{70,}?)(</a)|$1.substr($2, 0, 70)."...$3"|iseg;
+
 	return $html;
 }
 
@@ -4260,4 +4263,4 @@
 
 =head1 VERSION
 
-$Id: Data.pm,v 1.19 2006/09/01 15:53:38 sugi Exp $
+$Id: Data.pm,v 1.20 2006/09/06 10:16:48 sugi Exp $


Slashdotjp-dev メーリングリストの案内
Back to archive index