diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 074310835..aa56543de 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -74,6 +74,10 @@ module ApplicationHelper
end
end
+ def unescape_emoji(title)
+ PrettyText.unescape_emoji(title)
+ end
+
def with_format(format, &block)
old_formats = formats
self.formats = [format]
diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb
index 61862b061..959562b2e 100644
--- a/app/views/user_notifications/digest.html.erb
+++ b/app/views/user_notifications/digest.html.erb
@@ -20,7 +20,7 @@
<%- @featured_topics.each_with_index do |t, i| %>
- <%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
+
<%= raw unescape_emoji(t.title) %>
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
@@ -43,7 +43,7 @@
<%- @new_topics.each do |t| %>
-
- <%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
+ <%= raw unescape_emoji(t.title) %>
<%= t.posts_count %>
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb
index 0881296e8..f6e2d523b 100644
--- a/lib/pretty_text.rb
+++ b/lib/pretty_text.rb
@@ -226,6 +226,14 @@ module PrettyText
end
end
+ def self.unescape_emoji(title)
+ protect do
+ v8["title"] = title
+ decorate_context(v8)
+ v8.eval("Discourse.Emoji.unescape(title)")
+ end
+ end
+
def self.cook(text, opts={})
options = opts.dup