X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/903213e63fd6c409046f66e73881aba33c3926de..65e726f201d7b9919271cfe7e8a7314a6abf0fc3:/IkiWiki/Plugin/embed.pm?ds=inline diff --git a/IkiWiki/Plugin/embed.pm b/IkiWiki/Plugin/embed.pm index 2a1637392..a7d38358f 100644 --- a/IkiWiki/Plugin/embed.pm +++ b/IkiWiki/Plugin/embed.pm @@ -3,7 +3,7 @@ package IkiWiki::Plugin::embed; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; my $attribr=qr/[^<>"]+/; @@ -43,35 +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 getsetup () { #{{{ +sub getsetup () { return plugin => { safe => 1, rebuild => undef, }, -} #}}} +} -sub embed ($) { #{{{ +sub embed ($) { hook(type => "format", id => "embed", call => \&format) unless @embedded; push @embedded, shift; return "
"; -} #}}} +} -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/