Unescape HTML entities (#24019)
This commit is contained in:
parent
9dfe2dbd3f
commit
684a970b3c
2 changed files with 61 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue