]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/smiley.pm
supress redef warning
[ikiwiki.git] / IkiWiki / Plugin / smiley.pm
index 0c6f5d4272cba5fb8aff8ea68bf76935fca0b299..45d00abea2cbec47df02e05d9d93d5c8fcf9d08e 100644 (file)
@@ -19,7 +19,7 @@ sub setup () { #{{{
        }
        
        if (! %smileys) {
-               debug("failed to parse any smileys, disabling plugin");
+               debug(gettext("failed to parse any smileys, disabling plugin"));
                return;
        }
        
@@ -34,10 +34,10 @@ sub setup () { #{{{
 sub filter (@) { #{{{
        my %params=@_;
        
-       $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{
+       $params{content} =~ s{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}{
                $1 ? $2 : htmllink($params{page}, $params{page}, $smileys{$2}, 0, 0, $2)
        }egs;
-       
+
        return $params{content};
 } # }}}