Merge pull request #631 from Retrospring/answer-is-too-lo…

answerbox: use ActiveSupport's String#truncate
This commit is contained in:
Georg Gadinger 2022-08-20 14:36:35 +02:00 committed by GitHub
commit 85d2ffc5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -5,9 +5,8 @@
.card-body .card-body
- if display_all.nil? - if display_all.nil?
.answerbox__answer-text .answerbox__answer-text
= markdown a.content[0..640] = markdown a.content.truncate(640, omission: " [...]", separator: /\s/)
- if a.content.length > 640 - if a.content.length > 640
[...]
%p %p
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) } %a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
= t(".read") = t(".read")