]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/embed.pm
See also
[git.ikiwiki.info.git] / IkiWiki / Plugin / embed.pm
index 2a16373921436d78db16be6455fb59081149ecd2..a7d38358fe3ab4177c2cf6a7817f3e037f2c8e4a 100644 (file)
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::embed;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 
 my $attribr=qr/[^<>"]+/;
 
 
 my $attribr=qr/[^<>"]+/;
 
@@ -43,35 +43,35 @@ my $safehtml=qr{(
 
 my @embedded;
 
 
 my @embedded;
 
-sub import { #{{{
+sub import {
        hook(type => "getsetup", id => "embed", call => \&getsetup);
        hook(type => "filter", id => "embed", call => \&filter);
        hook(type => "getsetup", id => "embed", call => \&getsetup);
        hook(type => "filter", id => "embed", call => \&filter);
-} # }}}
+}
 
 
-sub getsetup () { #{{{
+sub getsetup () {
        return
                plugin => {
                        safe => 1,
                        rebuild => undef,
                },
        return
                plugin => {
                        safe => 1,
                        rebuild => undef,
                },
-} #}}}
+}
 
 
-sub embed ($) { #{{{
+sub embed ($) {
        hook(type => "format", id => "embed", call => \&format) unless @embedded;
        push @embedded, shift;
        return "<div class=\"embed$#embedded\"></div>";
        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};
        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};
         my %params=@_;
        $params{content} =~ s/<div class="embed(\d+)"><\/div>/$embedded[$1]/eg;
         return $params{content};
-} # }}}
+}
 
 1
 
 1