module Ecoportal module API class V2 class Page class Component class RichTextField < Page::Component passthrough :content HTML_TAGS_REX = /<("[^"]*"|'[^']*'|[^'">])*>/ def to_s remove_html_tags(content) end private def remove_html_tags(str) str = str.gsub(HTML_TAGS_REX, ' ') if str str = str.gsub(/[^[:print:]]/, '') if str str = str.gsub(": ", ' ') if str str = str.gsub(""", '"') if str str = str.gsub("&", '&') if str str end end end end end end end