X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/914c839ceb02fdbb36a49aa6548dc95beaf59ea4..96c7e31c34b10e343afb3f17eb1ca7c34aaa4123:/IkiWiki/Plugin/smiley.pm

diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm
index 1697a37c1..0d77916d0 100644
--- a/IkiWiki/Plugin/smiley.pm
+++ b/IkiWiki/Plugin/smiley.pm
@@ -87,10 +87,10 @@ MATCH:	while (m{(?:^|(?<=\s|>))(\\?)$smiley_regexp(?:(?=\s|<)|$)}g) {
 		}
 		else {
 			# Replace the smiley with its expanded value.
-			substr($_, $spos, length($smiley))=
-				htmllink($params{page}, $params{destpage},
+			my $link=htmllink($params{page}, $params{destpage},
 				         $smileys{$smiley}, linktext => $smiley);
-			pos=$epos+1;
+			substr($_, $spos, length($smiley))=$link;
+			pos=$epos+length($link);
 		}
 	}