use File::Spec;
use IkiWiki;
-sub linkify ($$) { #{{{
+sub linkify ($$$) { #{{{
+ my $lpage=shift;
my $page=shift;
my $content=shift;
$content =~ s{(\\?)$config{wiki_link_regexp}}{
- $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2)))
- : ( $1 ? "[[$3]]" : htmllink($page, titlepage($3)))
+ $2 ? ( $1 ? "[[$2|$3]]" : htmllink($lpage, $page, titlepage($3), 0, 0, pagetitle($2)))
+ : ( $1 ? "[[$3]]" : htmllink($lpage, $page, titlepage($3)))
}eg;
return $content;
$blosxom::version="is a proper perl module too much to ask?";
use warnings 'all';
do "/usr/bin/markdown";
+ require Encode;
}
if ($type eq '.mdwn') {
- $content=Markdown::Markdown($content);
+ # Markdown does character based stuff that does not work
+ # well with utf-8 strings.
+ $content=Encode::decode_utf8(Markdown::Markdown(Encode::encode_utf8($content)));
}
else {
error("htmlization of $type not supported");
$actions++;
}
if ($config{discussion}) {
- $template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
+ $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
$actions++;
}
$links{$page}=[findlinks($page, $content)];
- $content=linkify($page, $content);
+ $content=linkify($page, $page, $content);
$content=preprocess($page, $content);
$content=htmlize($type, $content);