- substr($_, $-[2], length($2))=
- htmllink($params{page}, $params{destpage}, $smileys{$2}, linktext => $2);
+ my $link=htmllink($params{page}, $params{destpage},
+ $smileys{$smiley}, linktext => $smiley);
+ substr($_, $spos, length($smiley))=$link;
+ pos=$epos+length($link);