From: Joey Hess Date: Thu, 17 Jul 2008 17:11:47 +0000 (-0400) Subject: fix pos setting X-Git-Tag: 2.53.1~20 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/2395a3896a095408a7ca2c7ebb49b92b246c88b6 fix pos setting What was really going on is that expanding a smiley modified the string and reset the match process. Force set pos so it continues on from the expanded smiley. (cherry picked from commit c4f124d78a4c6e227f2017452821c95c35544860) --- diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm index 96d7f5900..50f268627 100644 --- a/IkiWiki/Plugin/smiley.pm +++ b/IkiWiki/Plugin/smiley.pm @@ -79,11 +79,12 @@ MATCH: while (m{(?:^|(?<=\s|>))(\\?)$smiley_regexp(?:(?=\s|<)|$)}g) { substr($_, $spos, length($smiley))= htmllink($params{page}, $params{destpage}, $smileys{$smiley}, linktext => $smiley); + pos=$epos+1; } # Breaks out at end, otherwise it will scan through again, # replacing de-escaped ones. - last unless defined pos; + #last unless defined pos; } return $_;