module Jekyll::Algolia::Utils

def self.html_to_text(html)

html - String representation of the HTML node

Public: Convert an HTML string to its content only
def self.html_to_text(html)
  return nil if html.nil?
  text = Nokogiri::HTML(html).text
  text.tr("\n", ' ').squeeze(' ').strip
end