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 %> diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index 34c0bb98b..cafc5ff40 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -219,7 +219,7 @@ feature 'Commenting debates' do within "#comments" do expect(page).to have_content "I am moderating!" expect(page).to have_content "Moderator ##{moderator.id}" - expect(page).to have_css "p.is-moderator" + expect(page).to have_css "div.is-moderator" expect(page).to have_css "img.moderator-avatar" end end @@ -244,7 +244,7 @@ feature 'Commenting debates' do within "#comment_#{comment.id}" do expect(page).to have_content "I am moderating!" expect(page).to have_content "Moderator ##{moderator.id}" - expect(page).to have_css "p.is-moderator" + expect(page).to have_css "div.is-moderator" expect(page).to have_css "img.moderator-avatar" end @@ -275,7 +275,7 @@ feature 'Commenting debates' do within "#comments" do expect(page).to have_content "I am your Admin!" expect(page).to have_content "Administrator ##{admin.id}" - expect(page).to have_css "p.is-admin" + expect(page).to have_css "div.is-admin" expect(page).to have_css "img.admin-avatar" end end @@ -300,7 +300,7 @@ feature 'Commenting debates' do within "#comment_#{comment.id}" do expect(page).to have_content "Top of the world!" expect(page).to have_content "Administrator ##{admin.id}" - expect(page).to have_css "p.is-admin" + expect(page).to have_css "div.is-admin" expect(page).to have_css "img.admin-avatar" end diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index ad3c26be9..28f4f0d2d 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -219,7 +219,7 @@ feature 'Commenting proposals' do within "#comments" do expect(page).to have_content "I am moderating!" expect(page).to have_content "Moderator ##{moderator.id}" - expect(page).to have_css "p.is-moderator" + expect(page).to have_css "div.is-moderator" expect(page).to have_css "img.moderator-avatar" end end @@ -244,7 +244,7 @@ feature 'Commenting proposals' do within "#comment_#{comment.id}" do expect(page).to have_content "I am moderating!" expect(page).to have_content "Moderator ##{moderator.id}" - expect(page).to have_css "p.is-moderator" + expect(page).to have_css "div.is-moderator" expect(page).to have_css "img.moderator-avatar" end @@ -275,7 +275,7 @@ feature 'Commenting proposals' do within "#comments" do expect(page).to have_content "I am your Admin!" expect(page).to have_content "Administrator ##{admin.id}" - expect(page).to have_css "p.is-admin" + expect(page).to have_css "div.is-admin" expect(page).to have_css "img.admin-avatar" end end @@ -300,7 +300,7 @@ feature 'Commenting proposals' do within "#comment_#{comment.id}" do expect(page).to have_content "Top of the world!" expect(page).to have_content "Administrator ##{admin.id}" - expect(page).to have_css "p.is-admin" + expect(page).to have_css "div.is-admin" expect(page).to have_css "img.admin-avatar" end