X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8fa477fa28afdee85a973ffe2447538d3371f025..64a8c828b8cfa342118dd6e28b9dff43d83c6311:/IkiWiki/Plugin/smiley.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm index e85abbb85..932c2c4fe 100644 --- a/IkiWiki/Plugin/smiley.pm +++ b/IkiWiki/Plugin/smiley.pm @@ -3,12 +3,13 @@ package IkiWiki::Plugin::smiley; use warnings; use strict; -use IkiWiki; +use IkiWiki 2.00; my %smileys; my $smiley_regexp; sub import { #{{{ + add_underlay("smiley"); hook(type => "filter", id => "smiley", call => \&filter); } # }}} @@ -36,7 +37,7 @@ sub filter (@) { #{{{ build_regexp() unless defined $smiley_regexp; $params{content} =~ s{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}{ - $1 ? $2 : htmllink($params{page}, $params{page}, $smileys{$2}, linktext => $2) + $1 ? $2 : htmllink($params{page}, $params{destpage}, $smileys{$2}, linktext => $2) }egs if length $smiley_regexp; return $params{content};