]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Bugfix for wikilink containing an email address not showing up in brokenlinks list.
authorJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 22:35:29 +0000 (18:35 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 22:35:29 +0000 (18:35 -0400)
IkiWiki/Plugin/link.pm
debian/changelog
doc/bugs/emails_should_not_be_considered_as_broken_links.mdwn

index f6c3573f75f5508dc810464162e9fb9a1ad8f527..87e06ca899b51868646346a77670835caa7deb07 100644 (file)
@@ -64,23 +64,21 @@ sub checkconfig () {
        }
 }
 
-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/) {
+       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/)
 }
 
@@ -140,7 +138,7 @@ sub scan (@) {
        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));
                }
        }
index b25e9a596651fae7215d4a2005dc377cf6dfbd69..ece9df882ced98f202a1c8da77a493a365eb6f8e 100644 (file)
@@ -29,6 +29,8 @@ ikiwiki (3.20110609) UNRELEASED; urgency=low
     mode) (smcv)
   * inline: Handle obfuscated urls, such as the mailto urls generated by
     markdown when forcing urls absolute.
+  * Bugfix for wikilink containing an email address not showing up in 
+    brokenlinks list.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 09 Jun 2011 10:06:44 -0400
 
index 90d9fcefffb400dedc591755f4fc01904a8bcede..353c3653d296ed6b5f3ee34a5be74311f106d469 100644 (file)
@@ -3,3 +3,12 @@ The [[ikiwiki/directive/brokenlinks]] directive lists emails when used inside [[
 [[!brokenlinks pages="*@* and !recentchanges"]]
 
 > Weird.  The bug, imho, is that `\[[email-address]]` results in a marked-up email address. I think marking up email addresses into hyperlinks should be handled by a markup plugin (e.g. markdown), not by the wikilink parser. I feel the same way for external links, but it appears [this is all by design](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=07a08122d926ab6b7741c94bc6c0038ffe0113fb). — [[Jon]]
+
+>> I belive this was done for compatability with the wikicreole plugin.
+>> Since in creole, a wikilink can contain an email or full html link, 
+>> and it was easier to make ikiwiki's wikilinks do so too, rather
+>> than put entirely different link handling into creole.
+>>
+>> Anyway, I've fixed this, although it leaves some weirdness if a page
+>> is created with a name like an email address and that same email address
+>> was previously used for external links. [[done]] --[[Joey]]