mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 02:56:26 -05:00
FIX: allow long words if they contain periods
This commit is contained in:
parent
2c9a47dda5
commit
e46204d195
2 changed files with 5 additions and 1 deletions
|
@ -71,7 +71,7 @@ class TextSentinel
|
||||||
|
|
||||||
def seems_unpretentious?
|
def seems_unpretentious?
|
||||||
# Don't allow super long words if there is a word length maximum
|
# 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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,10 @@ describe TextSentinel do
|
||||||
expect(TextSentinel.new("error in org.gradle.internal.graph.CachingDirectedGraphWalker", max_word_length: 30)).to be_valid
|
expect(TextSentinel.new("error in org.gradle.internal.graph.CachingDirectedGraphWalker", max_word_length: 30)).to be_valid
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context 'title_sentinel' do
|
context 'title_sentinel' do
|
||||||
|
|
Loading…
Reference in a new issue