]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
remove leading dot from default_pageext
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 4 Jul 2006 01:29:45 +0000 (01:29 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 4 Jul 2006 01:29:45 +0000 (01:29 +0000)
fix preview to not assume it's the default page type, and instead get the
type from the page

IkiWiki.pm
IkiWiki/CGI.pm

index f8c1f9d3e544ba3386661e5c804237d6577fc186..d7c082b1decf3e691048bc8eaea1e863404f58d4 100644 (file)
@@ -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,
index 5e7f771719945155c01dcb1def77651dcb6dd599..3e4cbe4cf4a97598b42bf03fad16ff54b2269423 100644 (file)
@@ -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 {