]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
* Ensure that web edited pages always end in a newline.
[ikiwiki.git] / IkiWiki / CGI.pm
index 788d0487e1012d3d6fe4dd8359200e99bf186e15..33e670eacbd7291b6cd1a30092b33f9b80e6bd93 100644 (file)
@@ -33,10 +33,9 @@ sub showform ($$$$) { #{{{
                                buttons => $buttons);
                });
        }
                                buttons => $buttons);
                });
        }
-       else {
-               printheader($session);
-               print misctemplate($form->title, $form->render(submit => $buttons));
-       }
+
+       printheader($session);
+       print misctemplate($form->title, $form->render(submit => $buttons));
 }
 
 sub redirect ($$) { #{{{
 }
 
 sub redirect ($$) { #{{{
@@ -249,7 +248,7 @@ sub cgi_prefs ($$) { #{{{
        $form->field(name => "email", size => 50, fieldset => "preferences");
        $form->field(name => "subscriptions", size => 50,
                fieldset => "preferences",
        $form->field(name => "email", size => 50, fieldset => "preferences");
        $form->field(name => "subscriptions", size => 50,
                fieldset => "preferences",
-               comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")");
+               comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")");
        $form->field(name => "banned_users", size => 50,
                fieldset => "admin");
        
        $form->field(name => "banned_users", size => 50,
                fieldset => "admin");
        
@@ -386,7 +385,9 @@ sub cgi_editpage ($$) { #{{{
        $form->tmpl_param("can_commit", $config{rcs});
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
        $form->tmpl_param("can_commit", $config{rcs});
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
-               htmllink("", "", "HelpOnFormatting", noimageinline => 1));
+               htmllink("", "", "ikiwiki/formatting",
+                       noimageinline => 1,
+                       linktext => "FormattingHelp"));
        $form->tmpl_param("baseurl", baseurl());
        
        if ($form->submitted eq "Cancel") {
        $form->tmpl_param("baseurl", baseurl());
        
        if ($form->submitted eq "Cancel") {
@@ -551,6 +552,7 @@ sub cgi_editpage ($$) { #{{{
                });
                $content=~s/\r\n/\n/g;
                $content=~s/\r/\n/g;
                });
                $content=~s/\r\n/\n/g;
                $content=~s/\r/\n/g;
+               $content.="\n" if $content !~ /\n$/;
 
                $config{cgi}=0; # avoid cgi error message
                eval { writefile($file, $config{srcdir}, $content) };
 
                $config{cgi}=0; # avoid cgi error message
                eval { writefile($file, $config{srcdir}, $content) };