Allow TextSentinel#seems_unpretentious? to accept words joined with dashes or forward slashes. (Issue 1133)

This commit is contained in:
Nathan Nontell
2013-09-16 09:45:57 -04:00
parent 406c29e79a
commit d95172cb5d
2 changed files with 9 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ class TextSentinel
def seems_unpretentious?
# Don't allow super long words if there is a word length maximum
@opts[:max_word_length].blank? || @text.split(/\s/).map(&:size).max <= @opts[:max_word_length]
@opts[:max_word_length].blank? || @text.split(/\s|\/|-/).map(&:size).max <= @opts[:max_word_length]
end