Sha256: 35e407f874de81a0ff3fda4d94dd445fbbd59212c67dca39b03196e0aeae8b78

Contents?: true

Size: 280 Bytes

Versions: 1

Compression:

Stored size: 280 Bytes

Contents

class App.Helpers.Text
  constructor: (opts = {}) ->

  simpleFormat: (str) ->
    str = str.replace /\r\n?/, "\n"
    str = $.trim str
    if str.length > 0
      str = str.replace /\n\n+/g, '</p><p>'
      str = str.replace /\n/g, '<br>'
      str = '<p>' + str + '</p>'
    str

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 lib/assets/javascripts/loco/helpers/text.coffee