app/helpers/application_helper.rb
# Fomat the given +text+ with the text formater selected in the settings
Fomat the given +text+ with the text formater selected in the settings
Fomat the given + text + with the text formater selected in the settings
def format_text(*args, &block)
    if block_given?
      options      = args.first || {}
      format_text(capture(&block), options)
    else
      text         = args[0]
      options      = args[1] || {}
      formated_text = text
      formated_text = method(Setting.text_formatting.to_sym).call(formated_text)
      ERB::Util.html_escape(formated_text).html_safe
    end
  end
def format_text ( * args , & block ) if block_given? options = args . first || { } format_text ( capture ( & block ) , options ) else text = args [ 0 ] options = args [ 1 ] || { } formated_text = text formated_text = method ( Setting . text_formatting . to_sym ) . call ( formated_text ) ERB :: Util . html_escape ( formated_text ) . html_safe end end
Fomat the given +text+ with the text formater selected in the settings
Fomat the given + text + with the text formater selected in the settings
#.gsub(/\b(([\w-]+:\/\/?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/i) { link_to($1, $1) }
args
<not_specific>
block
<not_specific>