From eeb906cc57e8ec96f2afa83de36e6db04e14547c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Nov 2010 02:06:21 -0400 Subject: [PATCH] comments: Make postcomment() pagespec work when previewing a comment. (cherry picked from commit 78de33d2eaf8a187b610685f70e60b7d5946374f) Conflicts: debian/changelog --- IkiWiki/Plugin/comments.pm | 6 ++++++ debian/changelog | 2 ++ 2 files changed, 8 insertions(+) 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; } diff --git a/debian/changelog b/debian/changelog index 8ba3ce190..f94f69fd1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ ikiwiki (3.20100815.2) UNRELEASED; urgency=low * Fix htmlscrubber_skip to be matched on the source page, not the page it is inlined into. Should allow setting to "* and !comment(*)" to scrub comments, but leave your blog posts unscrubbed, etc. + * comments: Make postcomment() pagespec work when previewing a comment, + including during moderation. -- Joey Hess Sun, 15 Aug 2010 11:42:55 -0400 -- 2.39.2