Method: ActionView::Helpers::SanitizeHelper#strip_tags
- Defined in:
- actionview/lib/action_view/helpers/sanitize_helper.rb
#strip_tags(html) ⇒ Object
Strips all HTML tags from html
, including comments and special characters.
("Strip <i>these</i> tags!")
# => Strip these tags!
("<b>Bold</b> no more! <a href='more.html'>See more here</a>...")
# => Bold no more! See more here...
("<div id='top-bar'>Welcome to my website!</div>")
# => Welcome to my website!
("> A quote from Smith & Wesson")
# => > A quote from Smith & Wesson
104 105 106 |
# File 'actionview/lib/action_view/helpers/sanitize_helper.rb', line 104 def (html) self.class.full_sanitizer.sanitize(html)&.html_safe end |