summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-11-17 10:41:50 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-11 21:14:02 +0000
commitf49603bf8638ab539151114445e0b132fb518941 (patch)
tree5754ae848e299f677d23bcbaef6ee0564ff71cee
parent2857b301e76dba92f550ac3f5077dcad068d2686 (diff)
smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI
-rw-r--r--IkiWiki/Plugin/smcvpostcomment.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm
index 6bd3b2970..40ffe8164 100644
--- a/IkiWiki/Plugin/smcvpostcomment.pm
+++ b/IkiWiki/Plugin/smcvpostcomment.pm
@@ -8,9 +8,6 @@ package IkiWiki::Plugin::smcvpostcomment;
use warnings;
use strict;
use IkiWiki 2.00;
-use IkiWiki::Plugin::inline;
-use IkiWiki::Plugin::mdwn;
-use CGI 'escapeHTML';
use constant PLUGIN => "smcvpostcomment";
use constant PREVIEW => "Preview";
@@ -24,6 +21,13 @@ sub import { #{{{
hook(type => "htmlize", id => "_".PLUGIN,
call => \&IkiWiki::Plugin::mdwn::htmlize);
IkiWiki::loadplugin("inline");
+ IkiWiki::loadplugin("mdwn");
+} # }}}
+
+sub htmlize { # {{{
+ eval { use IkiWiki::Plugin::mdwn; };
+ error($@) if ($@);
+ return IkiWiki::Plugin::mdwn::htmlize(@_)
} # }}}
sub getsetup () { #{{{
@@ -65,6 +69,8 @@ sub preprocess (@) { #{{{
my $posts = '';
unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) {
+ eval { use IkiWiki::Plugin::inline; };
+ error($@) if ($@);
my @args = (
pages => "internal($params{page}/_comment_*)",
template => PLUGIN . "_display",