summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm2
-rw-r--r--IkiWiki/CGI.pm7
2 files changed, 6 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index f8c1f9d3e..d7c082b1d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -16,7 +16,7 @@ sub defaultconfig () { #{{{
wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/,
verbose => 0,
wikiname => "wiki",
- default_pageext => ".mdwn",
+ default_pageext => "mdwn",
cgi => 0,
rcs => 'svn',
notify => 0,
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 5e7f77171..3e4cbe4cf 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -317,10 +317,13 @@ sub cgi_editpage ($$) { #{{{
}
$page=lc($page);
- my $file=$page.$config{default_pageext};
+ my $file;
if (exists $pagesources{lc($page)}) {
$file=$pagesources{lc($page)};
}
+ else {
+ $file=$page.".".$config{default_pageext};
+ }
my $newfile=0;
if (! -e "$config{srcdir}/$file") {
$newfile=1;
@@ -360,7 +363,7 @@ sub cgi_editpage ($$) { #{{{
$form->field(name => "comments",
value => $comments, force => 1);
$form->tmpl_param("page_preview",
- htmlize($config{default_pageext},
+ htmlize(pagetype($file),
linkify($page, $page, $content)));
}
else {