my $content=shift;
my @links;
- while ($content =~ /$config{wiki_link_regexp}/g) {
+ while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
push @links, lc($1);
}
return @links;
my $content=shift;
my $file=shift;
- $content =~ s/$config{wiki_link_regexp}/htmllink(pagename($file), $1)/eg;
+ $content =~ s{(\\?)$config{wiki_link_regexp}}{
+ $1 ? "[[$2]]" : htmllink(pagename($file), $2)
+ }eg;
return $content;
} #}}}
sub setup () { # {{{
my $setup=possibly_foolish_untaint($config{setup});
+ delete $config{setup};
open (IN, $setup) || error("read $setup: $!\n");
local $/=undef;
my $code=<IN>;
close IN;
eval $code;
error($@) if $@;
- print "ikiwiki setup complete\n";
+ print "$config{wikiname} setup complete, now forcing a rebuild.\n";
+ $config{cgi}=0;
+ $config{rebuild}=1;
+ foreach my $c (keys %config) {
+ $config{$c}=possibly_foolish_untaint($config{$c})
+ if defined $config{$c};
+ }
+ refresh();
+ saveindex();
exit;
} #}}}