X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0ea5f43790fe2ce3cc40e9513191e72c67a1ee51..78de33d2eaf8a187b610685f70e60b7d5946374f:/IkiWiki/Plugin/comments.pm diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 851f4862e..57f5b1304 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -727,6 +727,10 @@ sub previewcomment ($$$) { my $page=shift; my $time=shift; + # Previewing a comment should implicitly enable comment posting mode. + my $oldpostcomment=$postcomment; + $postcomment=1; + my $preview = IkiWiki::htmlize($location, $page, '_comment', IkiWiki::linkify($location, $page, IkiWiki::preprocess($location, $page, @@ -745,6 +749,8 @@ sub previewcomment ($$$) { $template->param(have_actions => 0); + $postcomment=$oldpostcomment; + return $template->output; }