diff _doc/make.pl @ 73:2f31ecabe9ea

doc security
author wizard
date Mon, 29 Mar 2010 06:56:05 +0400
parents f47f93534005
children 84aa8c395fce
line wrap: on
line diff
--- a/_doc/make.pl	Fri Mar 26 16:26:31 2010 +0300
+++ b/_doc/make.pl	Mon Mar 29 06:56:05 2010 +0400
@@ -158,31 +158,31 @@
 sub view_seq_link {
 	my ($self,$text) = @_;
 	
-	if ($text =~ /^\s*(?:(\w+)\s+)?(\w+(?:\:\:\w+)+)\s*$/) {
+	$text =~ s/(\w+(?:\:\:\w+)+)/
+		if (my $url = $self->mk_filelink($1)) {
+			"<a href='$url'>$1<\/a>";
+		} else {
+			$1;
+		}
+	/gex;
 	
-		my ($keyword, $package) = ($1 || '',$2);
-		
-		my @path = split /::/, $package;
-		
-		pop @path if $keyword;		
-		shift @path if uc $path[0] eq 'IMPL';
-		
+	return "<code>$text</code>";
+}
+
+sub mk_filelink {
+	my ($self,$package) = @_;
+	
+	return undef unless $package; 
+	
+	my @path = split /::/, $package;
+	
+	if ($path[0] eq 'IMPL') {
+		shift @path;
 		if (-f File::Spec->catfile($LibDir,@path).".pm") {
-			return '<code><a href="'. '../'x($level-1) . File::Spec->catfile(@path) .'.html">'.$text.'</a></code>';			
-		}
-		
-	} elsif ($text =~ /^\s*(\w+(?:\:\:\w+)+)\s*-&gt;\s*(\w+)\s*$/) {
-		my ($package,$member) = ($1,$2);
-		
-		my @path = split /::/, $package;
-		shift @path;
-		
-		if (-f File::Spec->catfile($LibDir,@path).".pm") {
-			return '<code><a href="'. '../'x($level-1) . File::Spec->catfile(@path) .'.html">'.$text.'</a></code>';			
+			return '../'x($level-1) . File::Spec->catfile(@path).'.html';
 		}
 	}
-	
-	return "<code>$text</code>";
+	return undef;	
 }
 
 sub view_seq_code {