aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-12-22 16:21:00 +0100
committerJoey Hess <joey@kitenet.net>2007-12-22 13:10:55 -0500
commit1ac0fd03bb9e840b03aabe516557c24f43a9c450 (patch)
tree9577f964fbb21951f5fbf4e0530c328defc0e3b6 /IkiWiki
parent8937e5e2857ef1784e3a715878c9cd62d4022406 (diff)
downloadikiwiki-1ac0fd03bb9e840b03aabe516557c24f43a9c450.tar
ikiwiki-1ac0fd03bb9e840b03aabe516557c24f43a9c450.tar.gz
IkiWiki/Plugin/meta.pm <redir>: Support for specifying anchors.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 8555e1109..987262a48 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -108,13 +108,16 @@ sub preprocess (@) { #{{{
return "" if $page ne $destpage;
my $safe=0;
if ($value !~ /^\w+:\/\//) {
- add_depends($page, $value);
- my $link=bestlink($page, $value);
+ my ($redir_page, $redir_anchor) = split /\#/, $value;
+
+ add_depends($page, $redir_page);
+ my $link=bestlink($page, $redir_page);
if (! length $link) {
return "[[meta ".gettext("redir page not found")."]]";
}
$value=urlto($link, $page);
+ $value.='#'.$redir_anchor if defined $redir_anchor;
$safe=1;
# redir cycle detection