mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:39:52 +01:00
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
1 changed files with 1 additions and 2 deletions
|
@ -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 a new issue