def markdown(text, *flags)
      require 'bluecloth'

      if flags.include?(:safe)
        raise ArgumentError, 'The :safe flag has been removed. Mark the input HTML safe instead or downgrade to Formatize 1.x'
      end

      text = sanitize(text) unless text.html_safe?

      if text.blank?
        ""
      else
        flags_hash = {}
        flags.each do |flag|
          flags_hash[flag] = true
        end

        BlueCloth.new(text, flags_hash).to_html
      end.html_safe
    end
def markdown(text, *flags)
      require 'bluecloth'

      if flags.include?(:safe)
        raise ArgumentError, 'The :safe flag has been removed. Mark the input HTML safe instead or downgrade to Formatize 1.x'
      end

      text = sanitize(text) unless text.html_safe?

      if text.blank?
        ""
      else
        flags_hash = {}
        flags.each do |flag|
          flags_hash[flag] = true
        end

        BlueCloth.new(text, flags_hash).to_html
      end.html_safe
    end
Accepts a string of Markdown {http://daringfireball.net/projects/markdown/}
 and one or more flags. Often, the default behavior will be suitable and
 you will not have to pass it any flags:

   markdown("We are using __Markdown__ now!")
   # => "<p>We are using <strong>Markdown</strong> now!</p>"

 When necessary, flags are listed as such:

   markdown("(snip)", :flag1, :flag2, :flag3)
   # => "(snip)"

 The +bluecloth+ documentation {http://rubydoc.info/gems/bluecloth/BlueCloth}
 lists the available flags.

 It sanitizes the input using Rails' +sanitize+ prior to parsing.
 There are two ways to bypass pre-parsing sanitization:

 1. Pass a string that has been marked HTML safe. (Preferred).
 2. Use the special <tt>:safe</tt> flag, which is not passed on to the
    parser. _(Deprecated in 1.1, removed in 2.0)._