From: Simon McVittie Date: Sun, 23 Nov 2008 12:02:39 +0000 (+0000) Subject: Embed comments into comments_embed.tmpl rather than concatenating in perl X-Git-Tag: 2.71~125 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/430ac61f2142bc92b12d16067ca7b40202d0c589?ds=sidebyside Embed comments into comments_embed.tmpl rather than concatenating in perl --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 136dc258e..acc3ffdb3 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -69,8 +69,8 @@ sub preprocess (@) { #{{{ debug("page $params{page} => destpage $params{destpage}"); - my $posts = ''; unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { + my $posts = ''; eval q{use IkiWiki::Plugin::inline}; error($@) if ($@); my @args = ( @@ -89,10 +89,11 @@ sub preprocess (@) { #{{{ push @args, feedshow => $params{feedshow} if defined $params{feedshow}; push @args, timeformat => $params{timeformat} if defined $params{timeformat}; push @args, feedonly => $params{feedonly} if defined $params{feedonly}; - $posts = "\n" . IkiWiki::preprocess_inline(@args); + $posts = IkiWiki::preprocess_inline(@args); + $formtemplate->param("comments" => $posts); } - return $formtemplate->output . $posts; + return $formtemplate->output; } # }}} # FIXME: logic taken from editpage, should be common code?