Skip to content

Commit

Permalink
Fixed call to hpricot's inner_text method that was causing featured p…
Browse files Browse the repository at this point in the history
…rofile partial to break.
  • Loading branch information
Jonathon Brenner committed Dec 26, 2008
1 parent eabf449 commit 5c8ddf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/text_helper.rb
Expand Up @@ -11,8 +11,8 @@ def truncate_html(text, max_length = 30, ellipsis = "...")
return if text.nil?

doc = Hpricot(text.to_s)
ellipsis_length = Hpricot(ellipsis).inner_text.chars.length
content_length = doc.inner_text.chars.length
ellipsis_length = Hpricot(ellipsis).inner_text.length
content_length = doc.inner_text.length
actual_length = max_length - ellipsis_length

content_length > max_length ? doc.truncate(actual_length).inner_html + ellipsis : text.to_s
Expand Down

0 comments on commit 5c8ddf1

Please sign in to comment.