X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/ec866f83703e63c0750df0b955a3288434a127b3..0b46412c96aa78093da1cc6a830fd9a67c5aa188:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 88407584f..7d5668d74 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -103,6 +103,12 @@ sub checkconfig () { #{{{ } } + if (ref $config{ENV} eq 'HASH') { + foreach my $val (keys %{$config{ENV}}) { + $ENV{$val}=$config{ENV}{$val}; + } + } + if ($config{w3mmode}) { eval q{use Cwd q{abs_path}}; error($@) if $@; @@ -541,7 +547,7 @@ sub urlto ($$) { #{{{ my $from=shift; if (! length $to) { - return beautify_url(baseurl($from)); + return beautify_url(baseurl($from)."index.$config{htmlext}"); } if (! $destsources{$to}) { @@ -592,7 +598,7 @@ sub htmllink ($$$;@) { #{{{ page => pagetitle(lc($link), 1), from => $lpage ). - "\">?$linktext" + "\" rel=\"nofollow\">?$linktext" } } @@ -635,8 +641,9 @@ sub userlink ($) { #{{{ } } #}}} -sub htmlize ($$$) { #{{{ +sub htmlize ($$$$) { #{{{ my $page=shift; + my $destpage=shift; my $type=shift; my $content=shift; @@ -655,6 +662,7 @@ sub htmlize ($$$) { #{{{ run_hooks(sanitize => sub { $content=shift->( page => $page, + destpage => $destpage, content => $content, ); }); @@ -686,7 +694,7 @@ sub linkify ($$$) { #{{{ return $content; } #}}} -my %preprocessing; +our %preprocessing; our $preprocess_preview=0; sub preprocess ($$$;$$) { #{{{ my $page=shift; # the page the data comes from @@ -1256,6 +1264,7 @@ sub pagespec_translate ($) { #{{{ $code=0; } + no warnings; return eval 'sub { my $page=shift; '.$code.' }'; } #}}} @@ -1270,7 +1279,7 @@ sub pagespec_match ($$;@) { #{{{ } my $sub=pagespec_translate($spec); - return IkiWiki::FailReason->new('syntax error') if $@; + return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@; return $sub->($page, @params); } #}}}