mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: unescape emojis in digests
This commit is contained in:
parent
03f9668d60
commit
73e345fe8f
3 changed files with 14 additions and 2 deletions
|
@ -74,6 +74,10 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unescape_emoji(title)
|
||||||
|
PrettyText.unescape_emoji(title)
|
||||||
|
end
|
||||||
|
|
||||||
def with_format(format, &block)
|
def with_format(format, &block)
|
||||||
old_formats = formats
|
old_formats = formats
|
||||||
self.formats = [format]
|
self.formats = [format]
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
<%- @featured_topics.each_with_index do |t, i| %>
|
<%- @featured_topics.each_with_index do |t, i| %>
|
||||||
<div class='featured-topic'>
|
<div class='featured-topic'>
|
||||||
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
|
<a href='<%= Discourse.base_url + t.relative_url %>'><%= raw unescape_emoji(t.title) %></a>
|
||||||
<br/>
|
<br/>
|
||||||
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
|
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<%- @new_topics.each do |t| %>
|
<%- @new_topics.each do |t| %>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
|
<a href='<%= Discourse.base_url + t.relative_url %>'><%= raw unescape_emoji(t.title) %></a>
|
||||||
<span class='post-count'><%= t.posts_count %></span>
|
<span class='post-count'><%= t.posts_count %></span>
|
||||||
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
|
<%= category_badge(t.category, inline_style: true, absolute_url: true) %>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -226,6 +226,14 @@ module PrettyText
|
||||||
end
|
end
|
||||||
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={})
|
def self.cook(text, opts={})
|
||||||
options = opts.dup
|
options = opts.dup
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue