about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorChristian Schmidt <github@chsc.dk>2023-03-08 19:56:41 +0100
committerGitHub <noreply@github.com>2023-03-08 19:56:41 +0100
commit684a970b3c7ce19ec419c4db52b67a3b0903f493 (patch)
tree40db59a68e6c1b76a4198d96ec9c00dd5d86feed /app/lib
parent9dfe2dbd3f29d1d6f3ffb530c9d9e782b56b5c95 (diff)
Unescape HTML entities (#24019)
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/plain_text_formatter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/plain_text_formatter.rb b/app/lib/plain_text_formatter.rb
index 08aa29696..6fa2bc5d2 100644
--- a/app/lib/plain_text_formatter.rb
+++ b/app/lib/plain_text_formatter.rb
@@ -18,7 +18,7 @@ class PlainTextFormatter
     if local?
       text
     else
-      strip_tags(insert_newlines).chomp
+      html_entities.decode(strip_tags(insert_newlines)).chomp
     end
   end
 
@@ -27,4 +27,8 @@ class PlainTextFormatter
   def insert_newlines
     text.gsub(NEWLINE_TAGS_RE) { |match| "#{match}\n" }
   end
+
+  def html_entities
+    HTMLEntities.new
+  end
 end