mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-01 14:53:02 +01:00
Ensure elipsis character always gets added for long questions/answers
This commit is contained in:
parent
fa025ced92
commit
7f26c1fef3
1 changed files with 2 additions and 2 deletions
|
@ -42,8 +42,8 @@ class Services::Twitter < Service
|
||||||
tweet_text = ""
|
tweet_text = ""
|
||||||
|
|
||||||
until parsed_tweet[:valid]
|
until parsed_tweet[:valid]
|
||||||
tweet_text = "#{question_content[0..122]}#{'…' if original_question_length > question_content.length}" \
|
tweet_text = "#{question_content[0..122]}#{'…' if original_question_length > [123, question_content.length].min}" \
|
||||||
" — #{answer_content[0..123]}#{'…' if original_answer_length > answer_content.length} #{answer_url}"
|
" — #{answer_content[0..123]}#{'…' if original_answer_length > [124, answer_content.length].min} #{answer_url}"
|
||||||
|
|
||||||
parsed_tweet = Twitter::TwitterText::Validation::parse_tweet(tweet_text)
|
parsed_tweet = Twitter::TwitterText::Validation::parse_tweet(tweet_text)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue