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.
master
Joey Hess 2008-07-17 13:11:47 -04:00
parent 16c44bd209
commit c4f124d78a
1 changed files with 2 additions and 1 deletions

View 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 $_;