From 3013d13b381ac219ebf6d50b879d4736345f2642 Mon Sep 17 00:00:00 2001 From: Sergio Arbeo Date: Mon, 26 Oct 2015 01:25:53 +0100 Subject: [PATCH] Add paragraphs to comments Fix #600 --- app/helpers/text_with_links_helper.rb | 2 +- app/views/comments/_comment.html.erb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/text_with_links_helper.rb b/app/helpers/text_with_links_helper.rb index ca07daf39..fe726c51e 100644 --- a/app/helpers/text_with_links_helper.rb +++ b/app/helpers/text_with_links_helper.rb @@ -2,7 +2,7 @@ module TextWithLinksHelper def text_with_links(text) return unless text - sanitized = sanitize text, tags: [], attributes: [] + sanitized = sanitize(text, tags: [], attributes: []) Rinku.auto_link(sanitized, :all, 'target="_blank" rel="nofollow"').html_safe end diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index ac61483fc..e2ce326aa 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -63,17 +63,17 @@ <% if comment.as_administrator? %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% elsif comment.as_moderator? %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% elsif comment.user.official? && comment.user_id == @commentable.author_id %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% elsif comment.user.official? %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% elsif comment.user_id == @commentable.author_id %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% else %> -

<%= text_with_links comment.body %>

+
<%= simple_format text_with_links comment.body %>
<% end %> <%= render 'comments/votes', comment: comment %>