Skip to content

A platform for community discussion. Free, open, simple.

FIX: Display small post actions when embedding a topic (#9278)

Roman Rizzi6bceb1d15a49
diff --git a/app/helpers/embed_helper.rb b/app/helpers/embed_helper.rb
index 9db2fa5b9b8..42e728ddba2 100644
--- a/app/helpers/embed_helper.rb
+++ b/app/helpers/embed_helper.rb
@@ -17,6 +17,9 @@ module EmbedHelper
end
def get_html(post)
- raw PrettyText.format_for_email(post.cooked, post)
+ key = "js.action_codes.#{post.action_code}"
+ cooked = post.cooked.blank? ? I18n.t(key, when: nil).humanize : post.cooked
+
+ raw PrettyText.format_for_email(cooked, post)
end
end