0
0
Fork 0

Unescape HTML entities (#24019)

This commit is contained in:
Christian Schmidt 2023-03-08 19:56:41 +01:00 committed by GitHub
parent 9dfe2dbd3f
commit 684a970b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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