Permalink
Browse files

Prevent problematic characters after slice

  • Loading branch information...
1 parent af7863b commit b2ad74c3bb3ff353ddbb098ee0c27726222c8136 Alex Bredariol Grilo committed Nov 21, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models/answer.rb
View
@@ -66,8 +66,8 @@ def title(options = {})
end
def summary
- truncate(markdown2txt(body).
- slice((title(:truncated => true).size - 3)..-1).
+ truncate(markdown2txt(body).mb_chars.
+ slice((title(:truncated => true).mb_chars.size - 3)..-1).
to_s.
insert(0, ''),
:length => SearchResult::SUMMARY_SIZE,

0 comments on commit b2ad74c

Please sign in to comment.