Method: Rodbot::Refinements#html_to_text

Defined in:
lib/rodbot/refinements.rb

#html_to_textString

Converts HTML to plain text by removing all tags

Examples:

'<strong>important</strong>'.html_to_text   # => 'important'

Returns:

  • (String)

    text



82
83
84
85
86
# File 'lib/rodbot/refinements.rb', line 82

refine String do
  def html_to_text
    self.gsub(/<.*?>/, '')
  end
end