answerbox: use ActiveSupport's String#truncate
this change cuts off the answer after a word and not within one.
This commit is contained in:
parent
455e478e45
commit
8f86f8bc96
|
@ -5,9 +5,8 @@
|
|||
.card-body
|
||||
- if display_all.nil?
|
||||
.answerbox__answer-text
|
||||
= markdown a.content[0..640]
|
||||
= markdown a.content.truncate(640, omission: " [...]", separator: /\s/)
|
||||
- if a.content.length > 640
|
||||
[...]
|
||||
%p
|
||||
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
|
||||
= t(".read")
|
||||
|
|
Loading…
Reference in New Issue