	if ( $autolink ) {
		my @allowtag = qw(font marquee button input b i s strike tt u sup sub em strong blink img hr);
		my ($found,$invalue,$tag,$intag,$outtag,%count);
		my @value = split(/&lt;/,$FORM{'v'});
		my $first = shift(@value);
		$first = &autolink($first);

		foreach(@value){
			$found=$tag=$intag=$outtag='';
			$invalue = $_;			
			foreach (@allowtag){
				if($invalue =~ /^($_)\b(.*?)&gt;(.*)/i){
					($tag,$intag,$outtag) = ($1,$2,$3);
					$intag =~ s/\'|\"//g;
					$outtag = &autolink($outtag);
					if($_ eq 'img'){ # imgŗL̏
						last if($intag =~ /^\/|dynsrc|file:|mailto:|\?/i);
						last if($intag !~ /^\s/);
						$intag =~ s/\b(width|height)\s*=\s*(\d|\%)*\s*//gi;
					}
					elsif($_ eq 'hr'){ # hrŗL̏
						$intag =~ s/\b(width|height)\s*=\s*(\d|\%)*\s*//gi;
					}
					elsif($_ eq 'font' || $_ eq 'marquee' || $_ eq 'button' || $_ eq 'input'){
						last if($intag =~ /\b(javascript\s*:|style\s*=|point\-size\s*=)/i);
					}
					elsif($_ eq 'b' || $_ eq 'i' || $_ eq 's' || $_ eq 'strike' || $_ eq 'tt' || $_ eq 'u' || $_ eq 's' || $_ eq 'sup' || $_ eq 'sub' || $_ eq 'em' || $_ eq 'strong' || $_ eq 'blink'){
						last if($intag);
					}
					$count{$_}++;
				}
				elsif($invalue =~ /^(\/$_)&gt;(.*)/i && $_ ne 'hr' && $_ ne 'img'){ # ^Ȍꍇ
					$count{"_$_"}++;
					($tag,$outtag) = ($1,$2);
					$outtag = &autolink($outtag);
				}
				else{
					next;
				}
				$found++;
				last;
			}
			if($found){
				$_ = "<$tag$intag>$outtag";
			}
			else{
				$_ = &autolink($_);
				$_ = "&lt;$_";
			}
		}

		unshift(@value,$first);
		$FORM{'v'} = join('',(@value));
		$FORM{'v'} .= '<!--autoclose-->';

		#^O⊮(marqueeŏɕ悤sortj
		my @tagkey = grep(!/_|img|hr/,keys(%count));
		$i = 0;
		foreach(@tagkey){
			if($i != 0 && $tagkey[$i] eq 'marquee'){ #擪marqueeȂւ
				($tagkey[0],$tagkey[$i]) = ($tagkey[$i],$tagkey[0]);
				last;
			}
			$i++;
		}
		foreach(@tagkey){
			$FORM{'v'} .= "</$_>" x $count{$_};
		}

		sub autolink{
			$_[0] =~ s/((https?|ftp|gopher|telnet|whois|news):\/\/[^\s\.]+\.[\w\!\#\$\%\&\'\(\)\=\-\^\`\\\|\@\~\[\{\]\}\;\+\:\*\,\.\?\/]+)/<a href=\"$1\" target=\"link\">$1<\/a>/g;
			return($_[0]);					
		}
	}