]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / IkiWiki.pm
index 88407584fbf7f8f2b3c51de7a6cfd16df57626be..7d5668d74d6899f08019b964517223b693606db5 100644 (file)
@@ -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
                                ).
-                               "\">?</a>$linktext</span>"
+                               "\" rel=\"nofollow\">?</a>$linktext</span>"
                }
        }
        
@@ -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);
 } #}}}