sipb-www
/
ikiwiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "added the tweakbestlink hook"
[ikiwiki.git]
/
IkiWiki.pm
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index 90fedca4f5dfb5614c229be58f453ea83307ea28..ba1847093fce3d5a64aa1ae6508a5726cc6ee5c3 100644
(file)
--- a/
IkiWiki.pm
+++ b/
IkiWiki.pm
@@
-815,7
+815,6
@@
sub will_render ($$;$) { #{{{
sub bestlink ($$) { #{{{
my $page=shift;
my $link=shift;
sub bestlink ($$) { #{{{
my $page=shift;
my $link=shift;
- my $res=undef;
my $cwd=$page;
if ($link=~s/^\/+//) {
my $cwd=$page;
if ($link=~s/^\/+//) {
@@
-830,35
+829,25
@@
sub bestlink ($$) { #{{{
$l.=$link;
if (exists $links{$l}) {
$l.=$link;
if (exists $links{$l}) {
-
$res=
$l;
+
return
$l;
}
elsif (exists $pagecase{lc $l}) {
}
elsif (exists $pagecase{lc $l}) {
-
$res=
$pagecase{lc $l};
+
return
$pagecase{lc $l};
}
}
- } while
($cwd=~s{/?[^/]+$}{} && ! defined $res)
;
+ } while
$cwd=~s{/?[^/]+$}{}
;
- if (
! defined $res &&
length $config{userdir}) {
+ if (length $config{userdir}) {
my $l = "$config{userdir}/".lc($link);
if (exists $links{$l}) {
my $l = "$config{userdir}/".lc($link);
if (exists $links{$l}) {
-
$res=
$l;
+
return
$l;
}
elsif (exists $pagecase{lc $l}) {
}
elsif (exists $pagecase{lc $l}) {
-
$res=
$pagecase{lc $l};
+
return
$pagecase{lc $l};
}
}
}
}
- if (defined $res) {
- run_hooks(tweakbestlink => sub {
- $res=shift->(
- page => $page,
- link => $res);
- });
- return $res;
- }
- else {
- #print STDERR "warning: page $page, broken link: $link\n";
- return "";
- }
+ #print STDERR "warning: page $page, broken link: $link\n";
+ return "";
} #}}}
sub isinlinableimage ($) { #{{{
} #}}}
sub isinlinableimage ($) { #{{{