Sha256: 2e1933d9577989cf9f8beab7b8f9c1f421b43ec5b745b5266dfa021c0bd79b60

Contents?: true

Size: 289 Bytes

Versions: 4

Compression:

Stored size: 289 Bytes

Contents

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

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

export default Text

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loco-rails-3.0.3 test/dummy/node_modules/loco-js/src/helpers/text.coffee
loco-rails-3.0.2 test/dummy/node_modules/loco-js/src/helpers/text.coffee
loco-rails-3.0.1 test/dummy/node_modules/loco-js/src/helpers/text.coffee
loco-rails-3.0.0 test/dummy/node_modules/loco-js/src/helpers/text.coffee