feat(messages): render markdown in message body
uses redcarpet gem to render markdown to html. Also a html email template is added.
This commit is contained in:
parent
a7747c9e84
commit
0a2f528269
7 changed files with 37 additions and 4 deletions
|
|
@ -137,4 +137,4 @@ class Message < ApplicationRecord
|
|||
def create_salt
|
||||
self.salt = [Array.new(6) { rand(256).chr }.join].pack("m").chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
- if @message.can_toggle_private?(current_user)
|
||||
= link_to t('.change_visibility'), toggle_private_message_path(@message), method: :post, class: 'btn btn-mini'
|
||||
%hr/
|
||||
%p= simple_format(h(@message.body))
|
||||
= markdown(@message.body)
|
||||
%hr/
|
||||
%p
|
||||
= link_to t('.reply'), new_message_path(:message => {:reply_to => @message.id}), class: 'btn'
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
.panel-heading
|
||||
%b= h(message.sender_name)
|
||||
= format_time(message.created_at)
|
||||
.panel-body= simple_format(h(message.body))
|
||||
.panel-body= markdown(message.body)
|
||||
|
||||
%p
|
||||
= link_to t('.reply'), new_message_path(:message => {:reply_to => thread_message.id}), class: 'btn'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
= markdown(@message.body)
|
||||
%hr/
|
||||
%pre
|
||||
- if @message.group
|
||||
= raw t '.footer_group', group: @message.group.name
|
||||
= raw t '.footer', reply_url: new_message_url('message[reply_to]' => @message.id), msg_url: message_url(@message), profile_url: my_profile_url
|
||||
Loading…
Add table
Add a link
Reference in a new issue