Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Truncate and .gitignore fixes

  • Loading branch information...
commit b600e005142a83e4d883ac63792d2c1d76aa2138 1 parent 8a5ddea
Winton Welsh authored
Showing with 3 additions and 2 deletions.
  1. +3 −1 lib/app_helpers/truncate.rb
  2. +0 −1  resources/git/ignore
4 lib/app_helpers/truncate.rb
View
@@ -31,7 +31,9 @@ def truncate(max_length, logger)
module TextNode
def truncate(max_length, logger)
- Hpricot::Text.new(content[/\A.{#{max_length}}\w*\;?/m][/.*[\w\;]/m])
+ content.chars.length < max_length ?
+ Hpricot::Text.new(content) :
+ Hpricot::Text.new(content[/\A.{#{max_length}}\w*\;?/m][/.*[\w\;]/m])
end
end
1  resources/git/ignore
View
@@ -9,6 +9,5 @@ doc/*
log/*
public/cache/**/*
public/media/**/*
-public/images/captcha/*
tmp/**/*
vendor
Please sign in to comment.
Something went wrong with that request. Please try again.