[link-text=url] #### sub bb2html { $introtext =~ s/<.*?>//gi; # no html allowed, no math either ;) $introtext =~ s/\n\s*\n/\n\n/gi; $introtext =~ s/\n\n\n/\n\n/gi; $introtext =~ s/ / /gi; $introtext =~ s/\n/
/gi; $introtext =~ s/(?<=BR>)(http|https|ftp|gopher|telnet)/ $1/gi; $introtext =~ s/\s+$//gi; $introtext =~ s/^\s+//gi; $introtext .= " "; $introtext =~ s/\{/%7B/gi; $introtext =~ s/\}/%7D/gi; $introtext =~ s/\[([^A\]]{1,2})\s+.*?\]/\[$1\]/gi; $introtext =~ s/\[\/([^A\]]{1,2})\s+.*?\]/\[\/$1\]/gi; $introtext =~ s/\[([^A\]]{1,2})\]/<$1>/gi; $introtext =~ s/\[\/([^A\]]{1,2})\]/<\/$1>/gi; $introtext =~ s{\[([^=\]]+?)=(http|https|ftp|gopher|telnet)://([$URI::uric#]+?)\]}{ my($text, $proto, $url) = ($1, $2, $3); my $extra = ''; $extra = $1 if $url =~ s/([?!;:.,']+)$//; $extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//; qq[$text$extra]; }ogie; $introtext =~ s{(?])(http|https|ftp|gopher|telnet)://([$URI::uric#]+)}{ my($proto, $url) = ($1, $2); my $extra = ''; my $host_capture = $url; $host_capture =~ s/([^\/]*).*/$1/i; #$host_capture = substr($host_capture,0,17) . "..." if length($host_capture)>20; $extra = $1 if $url =~ s/([?!;:.,']+)$//; $extra = ')' . $extra if $url !~ /\(/ && $url =~ s/\)$//; qq[$host_capture$extra]; }ogie; return $introtext; }