- when "html"; HTML.new(text || "")
- when "markdown"; Markdown.new(text || "")
- when "text"; Text.new(text || "")
- else; nil
+ when "html" then HTML.new(text || "")
+ when "markdown" then Markdown.new(text || "")
+ when "text" then Text.new(text || "")
+ end
+ end
+
+ class SimpleFormat
+ include ActionView::Helpers::TextHelper
+ include ActionView::Helpers::OutputSafetyHelper
+
+ def sanitize(text)
+ Sanitize.clean(text, Sanitize::Config::OSM).html_safe