fix pos setting
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 17 Jul 2008 17:11:47 +0000 (13:11 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 17 Jul 2008 17:11:47 +0000 (13:11 -0400)
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.

IkiWiki/Plugin/smiley.pm

index 96d7f5900b2f0b109b89dc804db31a596c826edc..50f2686277afa2de60ef86bd88a870938f1c96e4 100644 (file)
@@ -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 $_;