fix: Use commonmarker instead of redcarpet (#1732)

This commit is contained in:
Pranav Raj S 2021-02-05 11:24:18 +05:30 committed by GitHub
parent 2012aab1d5
commit 351403457e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 10 deletions

View file

@ -30,7 +30,7 @@ gem 'haikunator'
# Template parsing safely # Template parsing safely
gem 'liquid' gem 'liquid'
# Parse Markdown to HTML # Parse Markdown to HTML
gem 'redcarpet' gem 'commonmarker'
##-- for active storage --## ##-- for active storage --##
gem 'aws-sdk-s3', require: false gem 'aws-sdk-s3', require: false

View file

@ -147,6 +147,8 @@ GEM
coderay (1.1.3) coderay (1.1.3)
coercible (1.0.0) coercible (1.0.0)
descendants_tracker (~> 0.0.1) descendants_tracker (~> 0.0.1)
commonmarker (0.21.1)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.7) concurrent-ruby (1.1.7)
connection_pool (2.2.3) connection_pool (2.2.3)
crack (0.4.3) crack (0.4.3)
@ -386,7 +388,6 @@ GEM
rb-fsevent (0.10.4) rb-fsevent (0.10.4)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
redcarpet (3.5.1)
redis (4.2.1) redis (4.2.1)
redis-namespace (1.8.0) redis-namespace (1.8.0)
redis (>= 3.0.4) redis (>= 3.0.4)
@ -446,6 +447,8 @@ GEM
rubocop (>= 0.87.0) rubocop (>= 0.87.0)
rubocop-rspec (1.43.2) rubocop-rspec (1.43.2)
rubocop (~> 0.87) rubocop (~> 0.87)
ruby-enum (0.9.0)
i18n
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
ruby2ruby (2.4.4) ruby2ruby (2.4.4)
ruby_parser (~> 3.1) ruby_parser (~> 3.1)
@ -598,6 +601,7 @@ DEPENDENCIES
bullet bullet
bundle-audit bundle-audit
byebug byebug
commonmarker
cypress-on-rails (~> 1.0) cypress-on-rails (~> 1.0)
database_cleaner database_cleaner
devise devise
@ -632,7 +636,6 @@ DEPENDENCIES
pundit pundit
rack-cors rack-cors
rails rails
redcarpet
redis redis
redis-namespace redis-namespace
redis-rack-cache redis-rack-cache

View file

@ -1,4 +1,3 @@
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
<% @messages.each do |message| %> <% @messages.each do |message| %>
<tr> <tr>
<td> <td>
@ -8,7 +7,7 @@
<tr> <tr>
<td style="padding-bottom: 16px;"> <td style="padding-bottom: 16px;">
<% if message.content %> <% if message.content %>
<%= markdown.render(message.content).html_safe %> <%= CommonMarker.render_html(message.content).html_safe %>
<% end %> <% end %>
<% if message.attachments %> <% if message.attachments %>
<% message.attachments.each do |attachment| %> <% message.attachments.each do |attachment| %>

View file

@ -1,4 +1,3 @@
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
<p>Hi <%= @contact.name %>,</p> <p>Hi <%= @contact.name %>,</p>
<p>You have new messages on your conversation.</p> <p>You have new messages on your conversation.</p>
@ -12,7 +11,7 @@
<tr> <tr>
<td style="padding: 10px 20px; margin: 5px 0 20px 0; background: #F2F3F7; border-radius: 10px; display: inline-block; font-family: "Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;"> <td style="padding: 10px 20px; margin: 5px 0 20px 0; background: #F2F3F7; border-radius: 10px; display: inline-block; font-family: "Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
<% if message.content %> <% if message.content %>
<%= markdown.render(message.content).html_safe %> <%= CommonMarker.render_html(message.content).html_safe %>
<% end %> <% end %>
<% if message.attachments %> <% if message.attachments %>
<% message.attachments.each do |attachment| %> <% message.attachments.each do |attachment| %>

View file

@ -1,9 +1,7 @@
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true) %>
<% @messages.each do |message| %> <% @messages.each do |message| %>
<p style="font-family: Roboto,"Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;"> <p style="font-family: Roboto,"Helvetica Neue",Tahoma,Arial,sans-serif; text-align: start; unicode-bidi: plaintext;">
<% if message.content %> <% if message.content %>
<%= markdown.render(message.content).html_safe %> <%= CommonMarker.render_html(message.content).html_safe %>
<% end %> <% end %>
<% if message.attachments %> <% if message.attachments %>
<% message.attachments.each do |attachment| %> <% message.attachments.each do |attachment| %>