aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/link.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-06-29 19:09:23 -0400
committerJoey Hess <joey@kitenet.net>2011-06-29 19:09:23 -0400
commit506d16a8a01e563601dee2ddde877cb8210a61ef (patch)
tree47ab3109e219d005e2bf421c013eab78a0926447 /IkiWiki/Plugin/link.pm
parenta965e024302c900df9a77ed9eccc8609d2986571 (diff)
downloadikiwiki-506d16a8a01e563601dee2ddde877cb8210a61ef.tar
ikiwiki-506d16a8a01e563601dee2ddde877cb8210a61ef.tar.gz
emails in wikilinks are always email addresses
If a page that looks like an email address exists, it can't be linked to. But that's unlikely. Better to be consistent; before this change, a wikilink with an email address in it could link to the email address or a page, depending on when the page was created and when the page with the link was updated.
Diffstat (limited to 'IkiWiki/Plugin/link.pm')
-rw-r--r--IkiWiki/Plugin/link.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
index 87e06ca89..ef01f1107 100644
--- a/IkiWiki/Plugin/link.pm
+++ b/IkiWiki/Plugin/link.pm
@@ -7,7 +7,7 @@ use IkiWiki 3.00;
my $link_regexp;
-my $email_regexp = qr/^.+@.+$/;
+my $email_regexp = qr/^.+@.+\..+$/;
my $url_regexp = qr/^(?:[^:]+:\/\/|mailto:).*/i;
sub import {
@@ -73,13 +73,7 @@ sub is_externallink ($$;$) {
$url.="#".$anchor;
}
- if ($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 ($$;$) {