summaryrefslogtreecommitdiff
path: root/ikiwiki
diff options
context:
space:
mode:
Diffstat (limited to 'ikiwiki')
-rwxr-xr-xikiwiki14
1 files changed, 8 insertions, 6 deletions
diff --git a/ikiwiki b/ikiwiki
index 0463ba15d..de7c60cc9 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -1079,14 +1079,16 @@ sub cgi_editpage ($$) { #{{{
$form->title("creating $page");
}
elsif ($form->field("do") eq "edit") {
- my $content="";
- if (exists $pagesources{lc($page)}) {
- $content=readfile("$config{srcdir}/$pagesources{lc($page)}");
- $content=~s/\n/\r\n/g;
+ if (! length $form->field('content')) {
+ my $content="";
+ if (exists $pagesources{lc($page)}) {
+ $content=readfile("$config{srcdir}/$pagesources{lc($page)}");
+ $content=~s/\n/\r\n/g;
+ }
+ $form->field(name => "content", value => $content,
+ force => 1);
}
$form->tmpl_param("page_select", 0);
- $form->field(name => "content", value => $content,
- force => 1);
$form->field(name => "page", type => 'hidden');
$form->title("editing $page");
}