diff options
author | Joey Hess <joey@kitenet.net> | 2010-06-09 14:33:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-06-09 14:39:17 -0400 |
commit | cdf4292846e6fe0fb877809ef0906ff6bddf6bf9 (patch) | |
tree | c79c9fa5cfe8eee1f44aecd1f0843c6b5d7be319 /IkiWiki.pm | |
parent | ba9b808c898a556541057ac9f524db2de2a33d77 (diff) | |
download | ikiwiki-cdf4292846e6fe0fb877809ef0906ff6bddf6bf9.tar ikiwiki-cdf4292846e6fe0fb877809ef0906ff6bddf6bf9.tar.gz |
Fix support for globbing in tagged() pagespecs.
The linktype check was being done on the relativised link target,
but %typedlinks uses the same link targets as %links, so that didn't work.
I think the bug only appeared when tagbase was not set.
This bugfix also let me factor out the common typedlink checking code.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index e2a3d216f..27fa4ca17 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2397,18 +2397,20 @@ sub match_link ($$;@) { unless $links && @{$links}; my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { + next unless (! defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}); + if (length $bestlink) { - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && $bestlink eq IkiWiki::bestlink($page, $p)) { + if ($bestlink eq IkiWiki::bestlink($page, $p)) { return IkiWiki::SuccessReason->new("$page links to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1) } } else { - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && match_glob($p, $link, %params)) { + if (match_glob($p, $link, %params)) { return IkiWiki::SuccessReason->new("$page links to page $p$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) } my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p_rel}) && match_glob($p_rel, $link, %params)) { + if (match_glob($p_rel, $link, %params)) { return IkiWiki::SuccessReason->new("$page links to page $p_rel$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) } } |