From f4815e3b120f130ee0b88e3f301664f08df215a5 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 12 Nov 2008 16:54:51 +0100 Subject: [PATCH] po(mybestlink): fixed when fed with path beginning with / Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 45ed96c65..03ee9c33c 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -391,9 +391,11 @@ sub mybestlink ($$) { #{{{ my $link=shift; my $res=$origsubs{'bestlink'}->(masterpage($page), $link); + my $normres=$res; + $normres=~s#^/##; if (length $res && ($config{po_link_to} eq "current" || $config{po_link_to} eq "negotiated") - && istranslatable($res) + && istranslatable($normres) && istranslation($page)) { return $res . "." . lang($page); }