]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/smiley.pm
another fix
[git.ikiwiki.info.git] / IkiWiki / Plugin / smiley.pm
index fcf3048b28f34c26f7512c9407f37326fcd305b2..124245b68f9f13979ed84d0ede65b4f177ad40c3 100644 (file)
@@ -43,6 +43,8 @@ sub filter (@) { #{{{
 MATCH: while (m{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}g) {
                my $escape=$1;
                my $smiley=$2;
+               my $epos=$-[1];
+               my $spos=$-[2];
 
                # Smilies are not allowed inside <pre> or <code>.
                # For each tag in turn, match forward to find the next <tag>
@@ -60,11 +62,11 @@ MATCH:      while (m{(?:^|(?<=\s))(\\?)$smiley_regexp(?:(?=\s)|$)}g) {
 
                if ($escape) {
                        # Remove escape.
-                       substr($_, $-[1], 1)="";
+                       substr($_, $epos, 1)="";
                }
                else {
                        # Replace the smiley with its expanded value.
-                       substr($_, $-[2], length($smiley))=
+                       substr($_, $spos, length($smiley))=
                                htmllink($params{page}, $params{destpage},
                                         $smileys{$smiley}, linktext => $smiley);
                }