Skip to content

Commit

Permalink
fix bug in setTokenRangeAttribute()
Browse files Browse the repository at this point in the history
  • Loading branch information
apemsel committed Mar 3, 2016
1 parent 22a6569 commit 0485eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TokenizedAttributedString.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function setTokenAttribute($i, $attribute, $state = true) {
*/
public function setTokenRangeAttribute($from, $to, $attribute, $state = true) {
$fromOffset = $this->tokenOffsets[$from];
$toOffset = $this->tokenOffsets[$to] + mb_strlen($this->tokens[$to] - 1, "utf-8");
$toOffset = $this->tokenOffsets[$to] + mb_strlen($this->tokens[$to], "utf-8") - 1;

return $this->setRange($fromOffset, $toOffset, $attribute, $state);
}
Expand Down

0 comments on commit 0485eff

Please sign in to comment.