]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/embed.pm
po(percenttranslated): fix issue with leading /
[git.ikiwiki.info.git] / IkiWiki / Plugin / embed.pm
index 4fc91d978a5295473fac4135270c14027304ad2b..664c95763c97be51995c092b0689c3544ab17155 100644 (file)
@@ -43,26 +43,35 @@ my $safehtml=qr{(
 
 my @embedded;
 
-sub import { #{{{
+sub import {
+       hook(type => "getsetup", id => "embed", call => \&getsetup);
        hook(type => "filter", id => "embed", call => \&filter);
-} # }}}
+}
 
-sub embed ($) { #{{{
+sub getsetup () {
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
+}
+
+sub embed ($) {
        hook(type => "format", id => "embed", call => \&format) unless @embedded;
        push @embedded, shift;
        return "<div class=\"embed$#embedded\"></div>";
-} #}}}
+}
 
-sub filter (@) { #{{{
+sub filter (@) {
        my %params=@_;
        $params{content} =~ s/$safehtml/embed($1)/eg;
        return $params{content};
-} # }}}
+}
 
-sub format (@) { #{{{
+sub format (@) {
         my %params=@_;
        $params{content} =~ s/<div class="embed(\d+)"><\/div>/$embedded[$1]/eg;
         return $params{content};
-} # }}}
+}
 
 1