summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/meta.pm7
-rw-r--r--debian/changelog1
-rw-r--r--doc/plugins/meta.mdwn3
-rw-r--r--doc/security.mdwn2
4 files changed, 10 insertions, 3 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
diff --git a/debian/changelog b/debian/changelog
index 75462b6f9..8d91bd95c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
ikiwiki (2.17) UNRELEASED; urgency=low
* Improved parentlinks special case for index pages.
+ * redir: Support for specifying anchors.
-- Joey Hess <joeyh@debian.org> Wed, 19 Dec 2007 16:39:07 -0500
diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn
index 0696dc08e..479d62c43 100644
--- a/doc/plugins/meta.mdwn
+++ b/doc/plugins/meta.mdwn
@@ -85,6 +85,9 @@ Supported fields:
However, this latter syntax won't be allowed if the [[htmlscrubber]] is
enabled, since it can be used to insert unsafe content.
+ For both cases, an anchor to jump to inside the destination page may also be
+ specified using the common `PAGE#ANCHOR` syntax.
+
If the field is not one of the above predefined fields, the metadata will be
written to the generated html page as a &lt;meta&gt; header. However, this
won't be allowed if the [[htmlscrubber]] is enabled, since it can be used to
diff --git a/doc/security.mdwn b/doc/security.mdwn
index 6e1d56a52..c51cd5b95 100644
--- a/doc/security.mdwn
+++ b/doc/security.mdwn
@@ -341,7 +341,7 @@ There are at least two configurations where this is exploitable:
notice.
This security hole was discovered on 26 November 2007 and fixed the same
-da with the release of ikiwiki 2.14. I recommend upgrading to this version
+day with the release of ikiwiki 2.14. I recommend upgrading to this version
if your wiki can be committed to by third parties. Alternatively, don't use
a trailing slash in the srcdir, and avoid the (unusual) configurations that
allow the security hole to be exploited.