class ActionText::Content
def to_plain_text
content = ActionText::Content.new("<script>alert()</script>")
browsers.
NOTE: that the returned string is not HTML safe and should not be rendered in
content.to_plain_text # => "safeunsafe"
content = ActionText::Content.new("
safe
")content.to_plain_text # => "Funny times!"
content = ActionText::Content.new("
Funny times!
")removed but HTML entities encoded.
Returns a plain-text version of the markup contained by the content, with tags
def to_plain_text render_attachments(with_full_attributes: false, &:to_plain_text).fragment.to_plain_text end