Skip to content

Commit

Permalink
Decode HTML entities in Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
julianguyen committed Jul 8, 2024
1 parent f477c8e commit 8f4037a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/helpers/notifications_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'cgi'

module NotificationsHelper
def comment_link(uniqueid, data)
Expand Down Expand Up @@ -26,7 +27,7 @@ def new_ally_request_link(uniqueid, data)
link = "/profile?uid=#{data[:uid]}"
link_html = "<a href=\"#{link}\">#{name_or_email(data)}</a>"
# rubocop:disable Layout/LineLength
"<div id=\"#{uniqueid}\"><div>#{t('notifications.ally.sent_html', link_to_user: link_html)}</div>#{request_actions(data[:user_id])}</div>"
CGI.unescapeHTML("<div id=\"#{uniqueid}\"><div>#{t('notifications.ally.sent_html', link_to_user: link_html)}</div>#{request_actions(data[:user_id])}</div>")
# rubocop:enable Layout/LineLength
end

Expand Down

0 comments on commit 8f4037a

Please sign in to comment.