my $link_regexp;
-my $email_regexp = qr/^.+@.+$/;
+my $email_regexp = qr/^.+@.+\..+$/;
my $url_regexp = qr/^(?:[^:]+:\/\/|mailto:).*/i;
sub import {
}
}
-sub is_externallink ($$;$$) {
+sub is_externallink ($$;$) {
my $page = shift;
my $url = shift;
my $anchor = shift;
- my $force = shift;
if (defined $anchor) {
$url.="#".$anchor;
}
- if (! $force && $url =~ /$email_regexp/) {
- # url looks like an email address, so we assume it
- # is supposed to be an external link if there is no
- # page with that name.
- return (! (bestlink($page, linkpage($url))))
- }
-
- return ($url =~ /$url_regexp/)
+ return ($url =~ /$url_regexp|$email_regexp/)
}
sub externallink ($$;$) {
my $content=$params{content};
while ($content =~ /(?<!\\)$link_regexp/g) {
- if (! is_externallink($page, $2, $3, 1)) {
+ if (! is_externallink($page, $2, $3)) {
add_link($page, linkpage($2));
}
}