Unescape HTML entities (#24019)

This commit is contained in:
Christian Schmidt
2023-03-08 19:56:41 +01:00
committed by Claire
parent 92a26638eb
commit 3f2e31800e
2 changed files with 61 additions and 6 deletions

View File

@ -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