diff --git a/lib/text_sentinel.rb b/lib/text_sentinel.rb index 4e9bf8840c8..e86a897b67c 100644 --- a/lib/text_sentinel.rb +++ b/lib/text_sentinel.rb @@ -71,7 +71,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 diff --git a/spec/components/text_sentinel_spec.rb b/spec/components/text_sentinel_spec.rb index f75a1764592..d1f68cff4c4 100644 --- a/spec/components/text_sentinel_spec.rb +++ b/spec/components/text_sentinel_spec.rb @@ -117,6 +117,10 @@ describe TextSentinel do expect(TextSentinel.new("error in org.gradle.internal.graph.CachingDirectedGraphWalker", max_word_length: 30)).to be_valid end + it "allows a long string with colons" do + expect(TextSentinel.new("error in org.gradle.internal.graph.CachingDirectedGraphWalker:colon", max_word_length: 30)).to be_valid + end + end context 'title_sentinel' do