X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/929b9de9c2b0f3ed1a0c9e006d084519bd5e0479..6ab0659a9debfcc1be37c71a15e4e1490d1b736a:/IkiWiki/CGI.pm?ds=inline diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 73afe2468..3e4cbe4cf 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -4,7 +4,7 @@ use warnings; use strict; use IkiWiki; use IkiWiki::UserInfo; -use encoding 'utf8'; # force use of utf8 for io layer +use open qw{:utf8 :std}; use Encode; package IkiWiki; @@ -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 {