smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI
parent
2857b301e7
commit
f49603bf86
|
@ -8,9 +8,6 @@ package IkiWiki::Plugin::smcvpostcomment;
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
use IkiWiki 2.00;
|
use IkiWiki 2.00;
|
||||||
use IkiWiki::Plugin::inline;
|
|
||||||
use IkiWiki::Plugin::mdwn;
|
|
||||||
use CGI 'escapeHTML';
|
|
||||||
|
|
||||||
use constant PLUGIN => "smcvpostcomment";
|
use constant PLUGIN => "smcvpostcomment";
|
||||||
use constant PREVIEW => "Preview";
|
use constant PREVIEW => "Preview";
|
||||||
|
@ -24,6 +21,13 @@ sub import { #{{{
|
||||||
hook(type => "htmlize", id => "_".PLUGIN,
|
hook(type => "htmlize", id => "_".PLUGIN,
|
||||||
call => \&IkiWiki::Plugin::mdwn::htmlize);
|
call => \&IkiWiki::Plugin::mdwn::htmlize);
|
||||||
IkiWiki::loadplugin("inline");
|
IkiWiki::loadplugin("inline");
|
||||||
|
IkiWiki::loadplugin("mdwn");
|
||||||
|
} # }}}
|
||||||
|
|
||||||
|
sub htmlize { # {{{
|
||||||
|
eval { use IkiWiki::Plugin::mdwn; };
|
||||||
|
error($@) if ($@);
|
||||||
|
return IkiWiki::Plugin::mdwn::htmlize(@_)
|
||||||
} # }}}
|
} # }}}
|
||||||
|
|
||||||
sub getsetup () { #{{{
|
sub getsetup () { #{{{
|
||||||
|
@ -65,6 +69,8 @@ sub preprocess (@) { #{{{
|
||||||
|
|
||||||
my $posts = '';
|
my $posts = '';
|
||||||
unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) {
|
unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) {
|
||||||
|
eval { use IkiWiki::Plugin::inline; };
|
||||||
|
error($@) if ($@);
|
||||||
my @args = (
|
my @args = (
|
||||||
pages => "internal($params{page}/_comment_*)",
|
pages => "internal($params{page}/_comment_*)",
|
||||||
template => PLUGIN . "_display",
|
template => PLUGIN . "_display",
|
||||||
|
|
Loading…
Reference in New Issue