Ensure elipsis character always gets added for long questions/answers
This commit is contained in:
parent
fa025ced92
commit
7f26c1fef3
|
@ -42,8 +42,8 @@ class Services::Twitter < Service
|
|||
tweet_text = ""
|
||||
|
||||
until parsed_tweet[:valid]
|
||||
tweet_text = "#{question_content[0..122]}#{'…' if original_question_length > question_content.length}" \
|
||||
" — #{answer_content[0..123]}#{'…' if original_answer_length > answer_content.length} #{answer_url}"
|
||||
tweet_text = "#{question_content[0..122]}#{'…' if original_question_length > [123, question_content.length].min}" \
|
||||
" — #{answer_content[0..123]}#{'…' if original_answer_length > [124, answer_content.length].min} #{answer_url}"
|
||||
|
||||
parsed_tweet = Twitter::TwitterText::Validation::parse_tweet(tweet_text)
|
||||
|
||||
|
|
Loading…
Reference in New Issue