- $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{
- $1 ? $2 : IkiWiki::htmllink($params{page}, $smileys{$2}, 0, 0, $2)
- }egs;
-
+ build_regexp() unless defined $smiley_regexp;
+ $params{content} =~ s{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}{
+ $1 ? $2 : htmllink($params{page}, $params{destpage}, $smileys{$2}, linktext => $2)
+ }egs if length $smiley_regexp;
+